aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2023-12-08 15:19:46 +0100
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2023-12-29 07:29:15 +0100
commitf2916ba1e749dc3aca47a256e1472e5032e2c9c8 (patch)
treecdbe61c08aa4761648b03da2db2b11b76eb3127b
parentc9c3ac00c1a27ff4bcdb0733789a94c738c35c93 (diff)
qa fixes
-rwxr-xr-xcheck2
-rw-r--r--kerbana/config.py1
-rw-r--r--kerbana/settings.py12
-rw-r--r--kerbana/tests/test_config.py1
-rw-r--r--rrd/management/commands/listen_mqtt.py1
-rw-r--r--rrd/models.py4
-rw-r--r--rrd/mqtt.py1
-rw-r--r--rrd/tests/test_mqtt.py1
-rw-r--r--setup.cfg7
9 files changed, 19 insertions, 11 deletions
diff --git a/check b/check
index 9f57f60..4821df4 100755
--- a/check
+++ b/check
@@ -35,7 +35,7 @@ case $SUBCMD in
;;
"qa")
cd "$root"
- flake8 --select=E,F,W,C90,E123 --ignore=W503 .
+ flake8 .
isort --check-only --diff .
if which doc8
then
diff --git a/kerbana/config.py b/kerbana/config.py
index 03664c0..358d2fe 100644
--- a/kerbana/config.py
+++ b/kerbana/config.py
@@ -4,7 +4,6 @@ import sys
import strictyaml
-
log = logging.getLogger(__name__)
diff --git a/kerbana/settings.py b/kerbana/settings.py
index d2ea290..ce01e5a 100644
--- a/kerbana/settings.py
+++ b/kerbana/settings.py
@@ -20,7 +20,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
-SECRET_KEY = 'django-insecure-kvy1kjt(lsl7dqlm*zjwu9hd&j(g)pch0hec5tlbp2pvm_m5i='
+SECRET_KEY = 'django-insecure-kvy1kjt(lsl7dqlm*zjwu9hd&j(g)pch0hec5tlbp2pvm'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
@@ -87,16 +87,16 @@ DATABASES = {
AUTH_PASSWORD_VALIDATORS = [
{
- 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
+ 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', # noqa: E501
},
{
- 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
+ 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', # noqa: E501
},
{
- 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
+ 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', # noqa: E501
},
{
- 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
+ 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', # noqa: E501
},
]
@@ -138,4 +138,4 @@ MQTT_TOPIC = "kerbana/#"
RRD_DB_PATH = BASE_DIR / ".." / "data" / "rrd"
RRD_GRAPH_PATH = BASE_DIR / ".." / "data" / "graph"
-from .config import *
+from .config import * # noqa
diff --git a/kerbana/tests/test_config.py b/kerbana/tests/test_config.py
index 43b611d..1e6b04f 100644
--- a/kerbana/tests/test_config.py
+++ b/kerbana/tests/test_config.py
@@ -5,6 +5,7 @@ from django.test import TestCase
import kerbana.config
+
class TestConfig(TestCase):
def test_config_from_env(self):
os.environ["KERBANA_CONFIG"] = os.path.join(
diff --git a/rrd/management/commands/listen_mqtt.py b/rrd/management/commands/listen_mqtt.py
index 758a4f2..3f0ff4e 100644
--- a/rrd/management/commands/listen_mqtt.py
+++ b/rrd/management/commands/listen_mqtt.py
@@ -2,6 +2,7 @@ from django.core.management.base import BaseCommand
import rrd.mqtt
+
class Command(BaseCommand):
help = "Listen to mqtt events and update rrd files and graphs"
diff --git a/rrd/models.py b/rrd/models.py
index 49efd57..6adc17f 100644
--- a/rrd/models.py
+++ b/rrd/models.py
@@ -1,6 +1,6 @@
-from django.db import models
-from django.conf import settings
import django.contrib.auth.models as amodels
+from django.conf import settings
+from django.db import models
class ModelWithPerms(models.Model):
diff --git a/rrd/mqtt.py b/rrd/mqtt.py
index 713d837..de679ce 100644
--- a/rrd/mqtt.py
+++ b/rrd/mqtt.py
@@ -3,7 +3,6 @@ import logging
import django.conf
import paho.mqtt.client as mqtt
-
log = logging.getLogger(__name__)
diff --git a/rrd/tests/test_mqtt.py b/rrd/tests/test_mqtt.py
index 4ea0852..0a7b90d 100644
--- a/rrd/tests/test_mqtt.py
+++ b/rrd/tests/test_mqtt.py
@@ -4,6 +4,7 @@ import django.test
from .. import mqtt
+
class TestMQTT(django.test.TestCase):
def setUp(self):
self.mqtt = mqtt.MQTTClient()
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..e560edd
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,7 @@
+[flake8]
+ select = E,F,W,C90,E123
+ ignore = W503
+ exclude = *migrations
+
+[isort]
+ skip = migrations