Skip to content

Commit 12ed42c

Browse files
authored
Modify report filename and output path in audit script
Updated the output file path to use a timestamped filename and a custom report location.
1 parent b71e962 commit 12ed42c

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

.github/scripts/hygeine/audit_drizzle_schema.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import sys
55
import argparse
66
from collections import defaultdict
7+
from datetime import datetime
78

89
def get_ts_files(root_dir):
910
"""Recursively find all TypeScript files, ignoring build/module directories."""
@@ -20,10 +21,20 @@ def get_ts_files(root_dir):
2021
return ts_files
2122

2223
def main():
24+
# Generate timestamp in yyyy-mm-dd 12h time format (e.g., 2026-03-13-06-44pm)
25+
now_str = datetime.now().strftime("%Y-%m-%d-%I-%M%p").lower()
26+
filename = f"drizzle-schema-report-{now_str}.md"
27+
28+
# User's custom report location (preserving original spelling of 'hygeine')
29+
default_report_path = os.path.join(os.getcwd(), "scripts", "reports", "hygeine", filename)
30+
2331
parser = argparse.ArgumentParser(description="Analyze Drizzle ORM schema and D1 usage.")
24-
parser.add_argument("--output", default="drizzle-schema-report.md", help="Output Markdown file path")
32+
parser.add_argument("--output", default=default_report_path, help="Output Markdown file path")
2533
args = parser.parse_args()
2634

35+
# Ensure the target directory exists before executing the file scan
36+
os.makedirs(os.path.dirname(args.output), exist_ok=True)
37+
2738
root_dir = os.getcwd()
2839
files = get_ts_files(root_dir)
2940

0 commit comments

Comments
 (0)