mirror of
https://github.com/open-webui/docs.git
synced 2025-12-12 07:29:49 +07:00
chore: format
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user