mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-28 09:16:49 +01:00
0257b2bcb9
* Use ruff formatter Ruff is now also a formatter! And it runs in a fraction of a second across our whole codebase vs "I waited more than 30s and cancelled it because I got bored". * Config and command -> ruff * Run 'ruff format .' * Update query snapshots * Run 'ruff format .' * Fix format after commit hook * Update query snapshots * Fix type error - ignore comment moved * Exclude hogql grammar from formatting and reverted grammar * Run format --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Tom Owers <tom@paace.co>
95 lines
2.4 KiB
TOML
95 lines
2.4 KiB
TOML
[tool.black]
|
|
line-length = 120
|
|
target-version = ['py310']
|
|
|
|
[tool.isort]
|
|
profile = "black"
|
|
|
|
[tool.ruff]
|
|
line-length = 120
|
|
exclude = [
|
|
".git",
|
|
"./plugin-server/node_modules/",
|
|
"./plugins/node_modules/",
|
|
"./env",
|
|
"./posthog/hogql/grammar",
|
|
]
|
|
ignore = [
|
|
"B006",
|
|
"B011",
|
|
"B017",
|
|
"B019",
|
|
"B024",
|
|
"B904",
|
|
"B905",
|
|
"C401",
|
|
"C408",
|
|
"C413",
|
|
"C414",
|
|
"C416",
|
|
"C417",
|
|
"C901",
|
|
"E501",
|
|
"E722",
|
|
"E731",
|
|
"F403",
|
|
"F405",
|
|
"F541",
|
|
"F601",
|
|
]
|
|
select = [
|
|
"B",
|
|
"C4",
|
|
"C9",
|
|
"E",
|
|
"F",
|
|
"T2",
|
|
"W",
|
|
]
|
|
|
|
[tool.ruff.mccabe]
|
|
max-complexity = 10
|
|
|
|
[tool.ruff.per-file-ignores]
|
|
"./posthog/queries/column_optimizer/column_optimizer.py" = ["F401"]
|
|
"./posthog/migrations/0027_move_elements_to_group.py" = ["T201"]
|
|
"./posthog/queries/cohort_query.py" = ["F401"]
|
|
"./posthog/client.py" = ["T201"]
|
|
"./posthog/async_migrations/test/test_migrations_not_required.py" = ["T201"]
|
|
"__init__.py" = ["F401"]
|
|
"./posthog/api/capture.py" = ["T201"]
|
|
"./ee/clickhouse/generate_local.py" = ["T201"]
|
|
"./posthog/management/commands/merge_distinct_emails.py" = ["T201"]
|
|
"./posthog/demo/matrix/matrix.py" = ["T201"]
|
|
"./posthog/migrations/0038_migrate_actions_to_precalculate_events.py" = ["T201"]
|
|
"./posthog/settings/overrides.py" = ["T201"]
|
|
"./bin/hobby-ci.py" = ["T201"]
|
|
"./posthog/management/commands/migrate_elementgroup.py" = ["T201"]
|
|
"./posthog/models/plugin.py" = ["T201"]
|
|
"./docker-compose-config.py" = ["T201"]
|
|
"./posthog/management/commands/backfill_persons_and_groups_on_events.py" = ["T201"]
|
|
"./posthog/management/commands/generate_demo_data.py" = ["T201"]
|
|
"./posthog/apps.py" = ["T201"]
|
|
"./posthog/management/commands/partition.py" = ["T201"]
|
|
"./posthog/management/commands/migrate_clickhouse.py" = ["T201"]
|
|
"./posthog/email.py" = ["T201"]
|
|
"./posthog/hogql/grammar/HogQLParser.py" = [
|
|
"F401",
|
|
"F841",
|
|
"E711",
|
|
]
|
|
"./posthog/celery.py" = ["T201"]
|
|
"./posthog/hogql/grammar/HogQLLexer.py" = ["F401"]
|
|
"./posthog/utils.py" = ["T201"]
|
|
"./posthog/management/commands/sync_feature_flags.py" = ["T201"]
|
|
"./cypress/wait.py" = ["T201"]
|
|
"./posthog/management/commands/notify_helm_install.py" = [
|
|
"T201",
|
|
"T203",
|
|
]
|
|
"./gunicorn.config.py" = ["T201"]
|
|
"./posthog/management/commands/run_async_migrations.py" = ["T201"]
|
|
"./posthog/management/commands/test_migrations_are_safe.py" = ["T201"]
|
|
"./posthog/management/commands/api_keys.py" = ["T201"]
|
|
"./posthog/demo/matrix/manager.py" = ["T201"]
|