chore: format

This commit is contained in:
silentoplayz
2025-10-05 23:29:50 -04:00
parent c4ada90210
commit 3e3da9e0a0
152 changed files with 2247 additions and 1677 deletions

View File

@@ -1,11 +1,11 @@
#!/usr/bin/env python3
# Only use stdlib to avoid needing to install dependencies
import ast
import sys
import urllib.request
import os
def find_env_vars(code, filename):
tree = ast.parse(code)
env_vars_found = {} # Dictionary to store env vars, filenames, defaults, and types
@@ -169,13 +169,11 @@ def find_env_vars(code, filename):
if env_vars_found[env_var]["type"] == "str": # Only set type if still default str, otherwise keep more specific type
env_vars_found[env_var]["type"] = context["type"]
visitor = EnvVarVisitor()
visitor.visit(tree)
visitor.finalize_env_vars(filename, env_vars_found) # Pass filename to finalize
return env_vars_found
def main():
if len(sys.argv) < 2:
print("Usage: scan-missing-env-vars.py <git_ref>")
@@ -209,7 +207,6 @@ def main():
if all_env_vars_with_context[env_var]["type"] == "str": # Only update type if still default str, keep more specific type
all_env_vars_with_context[env_var]["type"] = context["type"]
except urllib.error.URLError as e:
print(f"Failed to open URL: {e}")
sys.exit(1)
@@ -288,6 +285,5 @@ def main():
if not diff:
print("None")
if __name__ == "__main__":
main()