From 12d7ce56299faec9a13c2c33c924feb3c2ddf973 Mon Sep 17 00:00:00 2001 From: Klaas van Schelven Date: Thu, 6 Feb 2025 16:41:43 +0100 Subject: [PATCH] Flake8: for migrations _just_ ignore the whitespace errors this helps catching some _real_ errors while saving us from having to format automatically generated code --- events/migrations/0015_set_event_grouping.py | 1 + projects/migrations/0011_fill_stored_event_count.py | 1 + teams/migrations/0001_b_squashed_initial.py | 2 +- tox.ini | 4 +++- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/events/migrations/0015_set_event_grouping.py b/events/migrations/0015_set_event_grouping.py index 8088716..0464686 100644 --- a/events/migrations/0015_set_event_grouping.py +++ b/events/migrations/0015_set_event_grouping.py @@ -23,6 +23,7 @@ def set_event_grouping(apps, schema_editor): grouping = issue.grouping_set.first() Event.objects.filter(issue=issue).update(grouping=grouping) + class Migration(migrations.Migration): dependencies = [ diff --git a/projects/migrations/0011_fill_stored_event_count.py b/projects/migrations/0011_fill_stored_event_count.py index 9b79d14..4a428ee 100644 --- a/projects/migrations/0011_fill_stored_event_count.py +++ b/projects/migrations/0011_fill_stored_event_count.py @@ -1,5 +1,6 @@ from django.db import migrations + def unfill_stored_event_count(apps, schema_editor): Project = apps.get_model("projects", "Project") Project.objects.all().update(stored_event_count=0) diff --git a/teams/migrations/0001_b_squashed_initial.py b/teams/migrations/0001_b_squashed_initial.py index 68c8a6e..d25d292 100644 --- a/teams/migrations/0001_b_squashed_initial.py +++ b/teams/migrations/0001_b_squashed_initial.py @@ -18,7 +18,7 @@ class Migration(migrations.Migration): initial = True dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), # Defines AUTH_USER_MODEL, which we use + migrations.swappable_dependency(settings.AUTH_USER_MODEL), # Defines AUTH_USER_MODEL, which we use ] operations = [ diff --git a/tox.ini b/tox.ini index 0b5e02a..3b9c353 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,8 @@ [flake8] max-line-length=120 -exclude=venv,.venv,**/migrations/*,sentry/**,bugsink/event_schema.py +exclude=venv,.venv,sentry/**,bugsink/event_schema.py extend-ignore= # E741: ambiguous variable name E741 +per-file-ignores = + **/migrations/*:E501