0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-12-01 12:21:02 +01:00
posthog/.flake8

86 lines
4.3 KiB
Plaintext
Raw Normal View History

[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=
2022-02-17 16:30:21 +01:00
B001, # Do not use bare `except:`.
B006, # Do not use mutable data structures for argument defaults.
B008, # Do not perform function calls in argument defaults.
B009, # Do not call getattr with a constant attribute value, it is not any safer than normal property access.
B007, # Loop control variable 'i' not used within the loop body. If this is intended, start the name with an underscore
B011, # Do not call assert False since python -O removes these calls
B010, # Do not call setattr with a constant attribute value, it is not any safer than normal property access.
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().
C901, # function complexity
E203, # whitespace before :. -- Do not enable. We've disabled all formatting-related errors as 'black' takes care of them for us
2022-03-08 19:01:27 +01:00
E231, # missing whitespace after ,, ;, or :. -- Do not enable. We've disabled all formatting-related errors as 'black' takes care of them for us
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
E402, # module level import not at top of file
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
2022-02-17 16:30:21 +01:00
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
2021-12-20 16:23:24 +01:00
exclude =
.git,
./plugin-server/node_modules/
./plugins/node_modules/
./env
per-file-ignores =
__init__.py:F401
./posthog/queries/column_optimizer/column_optimizer.py:F401
refactor(FOSS): Split out cohort functionality (#10387) * refactor: foss move properties to /posthog * refactor: move replication and materializtaion * refactor: move file * refactor: move test and journeys * refactor: move breakdown props * refactor: move query imports * refactor: move more ee dependencies * refactor: restore groupsjoinquery * fix: errors * refactor: no ee.clickhouse dependncies * try import tasks * refactor: move materialization * refactor: change foss split for column optimizer * run black * fix: imports * remove comment * Update snapshots * run black * skip isort * Update snapshots * format * more fixes * refactor: move migrations * refactor: move idl * fix: move more imports * import adjustments * fix: test import * fix: test import * fix: remove restriction * refactor: split out paths query code * refactor: more code splitting * fix: types * refactor: split out cohort functionality * refactor: import * refactor: move negations * refactor(FOSS): split out paths query code (#10378) * refactor: move migrations * refactor: move idl * fix: move more imports * import adjustments * fix: test import * fix: test import * fix: remove restriction * refactor: split out paths query code * refactor: more code splitting * fix: types * refactor(FOSS): Setup such that FOSS is deployable (#10352) * refactor: move migrations * refactor: move idl * fix: move more imports * import adjustments * fix: test import * fix: test import * fix: remove restriction Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-06-23 17:34:46 +02:00
./posthog/queries/cohort_query.py:F401
2021-12-20 16:23:24 +01:00
./cypress/wait.py: T001
./docker-compose-config.py: T001
./posthog/client.py: T001
2021-12-20 16:23:24 +01:00
./ee/clickhouse/generate_local.py: T001
./posthog/management/commands/dry_run_matrix.py: T001
./posthog/management/commands/migrate_clickhouse.py: T001
./posthog/management/commands/run_async_migrations.py: T001
./posthog/management/commands/backfill_persons_and_groups_on_events.py: T001
2021-12-20 16:23:24 +01:00
./gunicorn.config.py: T001
./posthog/api/capture.py: T001
./posthog/apps.py: T001
./posthog/celery.py: T001
feat(demo): Rework demo data generation system (#7889) * Rework demo data generation system * Fix `setup_dev` and `posthog-foss` * Keep old demo data generators to reduce hassle * Move to Hoglify concept * Separate new generator from old version * Fix issues * Rework simulation structure * Restore package.json * Reformat `requirements` * Fix signup button margin * Refactor things * Remove snapshots * Strip old stuff * Rearrange more * Fix bad imports * Add simulation scaffolding * Add `dry_run_matrix` command * Fix determinism * Update naming * Update dry_run_matrix.py * Model web client, add sessions, enable full-cluster simulation * Update flake8 config * Ignore T001 violation * Fix saving data * Instrument `set_project_up` more * Add demo cohorts, feature flag, experiment * Parametrize `start` and `end` in `simulate_matrix` * Add neighbor effects * Add more events * Allow silencing events in `simulate_matrix` * Improve effect scheduling and add more activities * Fix time measurement * Disallow creating extra orgs for demo users * Add more useful info to `simulate_matrix` output * Add super properties, refine world * Fix first-seen moment * `create_event` to Kafka if possible for speed * Alias `$distinct_id` to `distinct_id` in `keyMapping` * Extend simulation to 120 days * Fix experiment instrumentation * Fix some error message * Fix experiment flag * Increase number of demo sim clusters * Fix typing * Remove unused agent actions * Support Python 3.8 * Avoid `Union[Team, int]` * Fix an arg * Remove dodgy alias
2022-05-17 22:23:11 +02:00
./posthog/demo/matrix/manager.py: T001
./posthog/demo/matrix/matrix.py: T001
2021-12-20 16:23:24 +01:00
./posthog/email.py: T001
./posthog/management/commands/api_keys.py: T001
./posthog/management/commands/merge_distinct_emails.py: T001
./posthog/management/commands/migrate_elementgroup.py: T001
./posthog/management/commands/notify_helm_install.py: T001 T003
./posthog/management/commands/partition.py: T001
feat(demo): Rework demo data generation system (#7889) * Rework demo data generation system * Fix `setup_dev` and `posthog-foss` * Keep old demo data generators to reduce hassle * Move to Hoglify concept * Separate new generator from old version * Fix issues * Rework simulation structure * Restore package.json * Reformat `requirements` * Fix signup button margin * Refactor things * Remove snapshots * Strip old stuff * Rearrange more * Fix bad imports * Add simulation scaffolding * Add `dry_run_matrix` command * Fix determinism * Update naming * Update dry_run_matrix.py * Model web client, add sessions, enable full-cluster simulation * Update flake8 config * Ignore T001 violation * Fix saving data * Instrument `set_project_up` more * Add demo cohorts, feature flag, experiment * Parametrize `start` and `end` in `simulate_matrix` * Add neighbor effects * Add more events * Allow silencing events in `simulate_matrix` * Improve effect scheduling and add more activities * Fix time measurement * Disallow creating extra orgs for demo users * Add more useful info to `simulate_matrix` output * Add super properties, refine world * Fix first-seen moment * `create_event` to Kafka if possible for speed * Alias `$distinct_id` to `distinct_id` in `keyMapping` * Extend simulation to 120 days * Fix experiment instrumentation * Fix some error message * Fix experiment flag * Increase number of demo sim clusters * Fix typing * Remove unused agent actions * Support Python 3.8 * Avoid `Union[Team, int]` * Fix an arg * Remove dodgy alias
2022-05-17 22:23:11 +02:00
./posthog/management/commands/simulate_matrix.py: T001
2021-12-20 16:23:24 +01:00
./posthog/management/commands/sync_feature_flags.py: T001
./posthog/management/commands/test_migrations_are_safe.py: T001
2021-12-20 16:23:24 +01:00
./posthog/migrations/0027_move_elements_to_group.py: T001
./posthog/migrations/0038_migrate_actions_to_precalculate_events.py: T001
./posthog/models/plugin.py: T001
./posthog/settings/overrides.py: T001
./posthog/utils.py: T001
./posthog/async_migrations/test/test_migrations_not_required.py: T001