home · contact · privacy
Re-write linting script and its dependencies to use lintplom. master
authorChristian Heller <c.heller@plomlompom.de>
Mon, 17 Mar 2025 08:36:20 +0000 (09:36 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 17 Mar 2025 08:36:20 +0000 (09:36 +0100)
.mypy.ini [deleted file]
.pylintrc [deleted file]
scripts/pre-commit
src/.pylintrc [new file with mode: 0644]
tests/.mypy.ini [new file with mode: 0644]
tests/.pylintrc [new file with mode: 0644]
tests/requirements.txt [new symlink]

diff --git a/.mypy.ini b/.mypy.ini
deleted file mode 100644 (file)
index e4f7658..0000000
--- a/.mypy.ini
+++ /dev/null
@@ -1,2 +0,0 @@
-[mypy]
-mypy_path = $MYPY_CONFIG_FILE_DIR/src
diff --git a/.pylintrc b/.pylintrc
deleted file mode 100644 (file)
index 45bc14d..0000000
--- a/.pylintrc
+++ /dev/null
@@ -1,3 +0,0 @@
-[BASIC]
-init-hook='import sys; sys.path[0:0] = ["src"]'
-good-names-rgxs=(.*_)?(GET|POST)(_.+)?,,test_[A-Z]+
index 3707445fdb3636dbc429c7bbcfde8316545633df..a8c4fd4d779419fa8ef4ea727cf5a915ac14b935 100755 (executable)
@@ -1,12 +1,20 @@
 #!/bin/sh
+set -e
+
+echo "===[ Running linters on source directories. ]==="
 DIRS='src src/taskplom tests'
-TOOLS='flake8 pylint mypy'
-for dir in $DIRS; do
-    for tool in $TOOLS; do
-        echo "Running ${tool} on ${dir}/ …."
-        python3 -m ${tool} ${dir}/*.py
-    done
+DIRS=tests
+for DIR in $DIRS; do
+    lintplom "${DIR}"
 done
-echo "Running unittest-parallel on tests/."
-set -e
+
+echo "\n\n===[ Running unittest-parallel on tests/. ]==="
+DIR_VENV=/tmp/taskplom_venv_unittest_parallel
+if [ ! -d "${DIR_VENV}" ]; then
+    mkdir "${DIR_VENV}"
+    python3 -m venv "${DIR_VENV}"
+fi
+. "${DIR_VENV}/bin/activate"
+pip3 install unittest-parallel
+pip3 install -r tests/requirements.txt
 unittest-parallel -t . -s tests/ -p '*.py'
diff --git a/src/.pylintrc b/src/.pylintrc
new file mode 100644 (file)
index 0000000..86d4879
--- /dev/null
@@ -0,0 +1,2 @@
+[BASIC]
+good-names-rgxs=(.*_)?(GET|POST)(_.+)?
diff --git a/tests/.mypy.ini b/tests/.mypy.ini
new file mode 100644 (file)
index 0000000..bf0df38
--- /dev/null
@@ -0,0 +1,2 @@
+[mypy]
+mypy_path = $MYPY_CONFIG_FILE_DIR/../src
diff --git a/tests/.pylintrc b/tests/.pylintrc
new file mode 100644 (file)
index 0000000..c18ad05
--- /dev/null
@@ -0,0 +1,3 @@
+[BASIC]
+init-hook='import sys; sys.path[0:0] = ["../src"]'
+good-names-rgxs=(.*_)?(GET|POST)(_.+)?,test_[A-Z]+
diff --git a/tests/requirements.txt b/tests/requirements.txt
new file mode 120000 (symlink)
index 0000000..86715e6
--- /dev/null
@@ -0,0 +1 @@
+../src/requirements.txt
\ No newline at end of file