Skip to content

Commit

Permalink
chore(dev): Allow mypy to run in VS Code extension
Browse files Browse the repository at this point in the history
  • Loading branch information
Twixes committed Apr 26, 2024
1 parent b2c00bf commit 6503fe0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions posthog/settings/access.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,10 @@
if not DEBUG and not TEST and SECRET_KEY == DEFAULT_SECRET_KEY:
logger.critical(
"""
You are using the default SECRET_KEY in a production environment!
For the safety of your instance, you must generate and set a unique key.,
More information on
https://posthog.com/docs/self-host/configure/securing-posthog,
"""
You are using the default SECRET_KEY in a production environment!
For the safety of your instance, you must generate and set a unique key.
"""
+ str(sys.argv)
)
sys.exit("[ERROR] Default SECRET_KEY in production. Stopping Django server…\n")

Expand Down
2 changes: 1 addition & 1 deletion posthog/settings/overrides.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
if runner:
cmd = sys.argv[1] if len(sys.argv) >= 2 else None

if cmd == "test" or runner.endswith("pytest") or runner.endswith("mypy"):
if cmd == "test" or runner.endswith("pytest") or runner.endswith("mypy") or "/mypy/" in runner:
print("Running in test mode. Setting DEBUG and TEST environment variables.")
os.environ["DEBUG"] = "1"
os.environ["TEST"] = "1"

0 comments on commit 6503fe0

Please sign in to comment.