forked from PostHog/posthog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.flake8
91 lines (87 loc) · 4.66 KB
/
.flake8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
[flake8]
application-import-names = posthog
import-order-style = pycharm
max-complexity = 10
# Error / Violation code details are available at:
#
# - https://pep8.readthedocs.io/en/latest/intro.html#error-codes
# - https://flake8.pycqa.org/en/latest/user/error-codes.html
#
ignore=
B001, # Do not use bare `except:`.
B006, # Do not use mutable data structures for argument defaults.
B011, # Do not call assert False since python -O removes these calls
B017, # assertRaises(Exception): should be considered evil
B019, # Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks.
B024, # ClickhouseFunnelBase is an abstract base class, but it has no abstract methods. Remember to use @abstractmethod, @abstractclassmethod and/or @abstractproperty decorators.
C400, # Unnecessary generator - rewrite as a list comprehension
C401, # Unnecessary generator - rewrite as a set comprehension.
C403, # Unnecessary list comprehension - rewrite as a set comprehension.
C405, # Unnecessary list literal - rewrite as a set literal.
C407, # Unnecessary list comprehension - 'any' can take a generator.
C408, # Unnecessary dict call - rewrite as a literal.
C413, # Unnecessary list call around sorted()
C414, # Unnecessary list call within sorted().
C416, # Unnecessary list comprehension - rewrite using list().
C417, # Unnecessary use of map - use a generator expression instead.
C901, # function complexity
E203, # whitespace before ‘:’. -- Do not enable. We've disabled all formatting-related errors as 'black' takes care of them for us
E231, # missing whitespace after ‘,’, ‘;’, or ‘:’. -- Do not enable. We've disabled all formatting-related errors as 'black' takes care of them for us
E262, # inline comment should start with '# '
E302, # expected 2 blank lines, found 0. -- Do not enable. we've disabled all formatting-related errors as 'black' takes care of them for us
E501, # line too long. -- Do not enable. We've disabled all formatting-related errors as 'black' takes care of them for us
E722, # do not use bare except, specify exception instead
E731, # do not assign a lambda expression, use a def
F403, # ‘from module import *’ used; unable to detect undefined names
F405, # name may be undefined, or defined from star imports: module
F541, # f-string without any placeholders
F601, # dictionary key name repeated with different values
G001, # Logging statement uses string.format()
G003, # Logging statement uses '+'
G004, # Logging statement uses f-string
G010, # Logging statement uses 'warn' instead of 'warning'
G200, # Logging statement uses exception in arguments
G201, # Logging: .exception(...) should be used instead of .error(..., exc_info=True)
I100, # Import statements are in the wrong order.
I101, # Imported names are in the wrong order
I201, # Missing newline between import groups.
I202, # Additional newline in a group of imports
W503, # line break before binary operator
exclude =
.git,
./plugin-server/node_modules/
./plugins/node_modules/
./env
per-file-ignores =
__init__.py:F401
./bin/hobby-ci.py: T201
./cypress/wait.py: T201
./docker-compose-config.py: T201
./ee/clickhouse/generate_local.py: T201
./gunicorn.config.py: T201
./posthog/management/commands/migrate_clickhouse.py: T201
./posthog/management/commands/run_async_migrations.py: T201
./posthog/management/commands/backfill_persons_and_groups_on_events.py: T201
./posthog/api/capture.py: T201
./posthog/apps.py: T201
./posthog/celery.py: T201
./posthog/client.py: T201
./posthog/demo/matrix/manager.py: T201
./posthog/demo/matrix/matrix.py: T201
./posthog/email.py: T201
./posthog/management/commands/api_keys.py: T201
./posthog/management/commands/merge_distinct_emails.py: T201
./posthog/management/commands/migrate_elementgroup.py: T201
./posthog/management/commands/notify_helm_install.py: T201 T203
./posthog/management/commands/partition.py: T201
./posthog/management/commands/generate_demo_data.py: T201
./posthog/management/commands/sync_feature_flags.py: T201
./posthog/management/commands/test_migrations_are_safe.py: T201
./posthog/migrations/0027_move_elements_to_group.py: T201
./posthog/migrations/0038_migrate_actions_to_precalculate_events.py: T201
./posthog/queries/column_optimizer/column_optimizer.py:F401
./posthog/queries/cohort_query.py:F401
./posthog/models/plugin.py: T201
./posthog/settings/overrides.py: T201
./posthog/utils.py: T201
./posthog/async_migrations/test/test_migrations_not_required.py: T201