]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
ci: add a check for tabs 783/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 3 Sep 2021 11:41:33 +0000 (13:41 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 5 Sep 2021 10:46:01 +0000 (12:46 +0200)
Surprisingly, none of the standard tools complain about tabs in the
code, at least in some locations. I expected that python3 would always
complain, or at least tabnanny, or pyflakes… Let's roll a simple custom
check.

Use '-P' to request perl-compatible regular expressions even the user
has a different default configures so that '\t' works as expected.

.github/workflows/ci-unit-test.yml

index 798d3e600d8b703acc72e302e51165cec4e43dc8..5eaa72713f8972cecf35df5dbf541869b081d584 100644 (file)
@@ -25,6 +25,9 @@ jobs:
     - name: Run pyflakes
       run: python3 -m pyflakes mkosi/ tests/
 
+    - name: Check that tabs are not used in code
+      run: sh -c '! git grep -P "\\t" "*.py"'
+
     - name: Type Checking (mypy)
       run: python3 -m mypy --python-version 3.7 mkosi