From 129a8db4219ebe32a86fde8936a4bc5e9dcb1a6d Mon Sep 17 00:00:00 2001 From: Klaas van Schelven Date: Wed, 21 Aug 2024 09:31:05 +0200 Subject: [PATCH] Fix various flake8 errors --- alerts/admin.py | 2 -- alerts/models.py | 2 -- ingest/management/commands/raise_exception.py | 6 +++--- releases/views.py | 2 -- snappea/admin.py | 2 -- snappea/tests.py | 2 -- snappea/views.py | 2 -- teams/tests.py | 2 -- theme/templatetags/datetime_formatting.py | 2 +- tox.ini | 2 +- users/tests.py | 2 -- 11 files changed, 5 insertions(+), 21 deletions(-) diff --git a/alerts/admin.py b/alerts/admin.py index 8c38f3f..846f6b4 100644 --- a/alerts/admin.py +++ b/alerts/admin.py @@ -1,3 +1 @@ -from django.contrib import admin - # Register your models here. diff --git a/alerts/models.py b/alerts/models.py index 71a8362..6b20219 100644 --- a/alerts/models.py +++ b/alerts/models.py @@ -1,3 +1 @@ -from django.db import models - # Create your models here. diff --git a/ingest/management/commands/raise_exception.py b/ingest/management/commands/raise_exception.py index dc45f18..5c048e4 100644 --- a/ingest/management/commands/raise_exception.py +++ b/ingest/management/commands/raise_exception.py @@ -34,9 +34,9 @@ class Command(BaseCommand): raise ValueError(msg) def raise_exception_from(self, msg, e): - s = "foo" - l = ["bar", 1, None, ["bar", 1, None]] - d = { + s = "foo" # noqa unused variable, but we want to test that it shows up in the local variables in Bugsink + l = ["bar", 1, None, ["bar", 1, None]] # noqa + d = { # noqa "foo": "bar", "baz": 1, "snu": None, diff --git a/releases/views.py b/releases/views.py index 91ea44a..60f00ef 100644 --- a/releases/views.py +++ b/releases/views.py @@ -1,3 +1 @@ -from django.shortcuts import render - # Create your views here. diff --git a/snappea/admin.py b/snappea/admin.py index 8c38f3f..846f6b4 100644 --- a/snappea/admin.py +++ b/snappea/admin.py @@ -1,3 +1 @@ -from django.contrib import admin - # Register your models here. diff --git a/snappea/tests.py b/snappea/tests.py index 7ce503c..a39b155 100644 --- a/snappea/tests.py +++ b/snappea/tests.py @@ -1,3 +1 @@ -from django.test import TestCase - # Create your tests here. diff --git a/snappea/views.py b/snappea/views.py index 91ea44a..60f00ef 100644 --- a/snappea/views.py +++ b/snappea/views.py @@ -1,3 +1 @@ -from django.shortcuts import render - # Create your views here. diff --git a/teams/tests.py b/teams/tests.py index 7ce503c..a39b155 100644 --- a/teams/tests.py +++ b/teams/tests.py @@ -1,3 +1 @@ -from django.test import TestCase - # Create your tests here. diff --git a/theme/templatetags/datetime_formatting.py b/theme/templatetags/datetime_formatting.py index f2410cb..0685c5b 100644 --- a/theme/templatetags/datetime_formatting.py +++ b/theme/templatetags/datetime_formatting.py @@ -32,6 +32,6 @@ def short_given_now(value): # because I want to compare 2 local times here (e.g. to know what the date boundary is) # useful bits: - now = timezone.now() + now = timezone.now() # noqa default_timezone = timezone.get_current_timezone() timezone.localtime(value, default_timezone) diff --git a/tox.ini b/tox.ini index 2c7b1c9..a0f97d9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [flake8] max-line-length=120 -exclude=venv,.venv,migrations +exclude=venv,.venv,**/migrations/*,sentry/** extend-ignore= # E741: ambiguous variable name E741 diff --git a/users/tests.py b/users/tests.py index 7ce503c..a39b155 100644 --- a/users/tests.py +++ b/users/tests.py @@ -1,3 +1 @@ -from django.test import TestCase - # Create your tests here.