From 727349cc01cf9893c5e4bb68f2f3c79668509b73 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 3 Sep 2021 13:41:33 +0200 Subject: [PATCH] ci: add a check for tabs MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci-unit-test.yml b/.github/workflows/ci-unit-test.yml index 798d3e600..5eaa72713 100644 --- a/.github/workflows/ci-unit-test.yml +++ b/.github/workflows/ci-unit-test.yml @@ -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 -- 2.47.2