From 3bff086993a3a7fd72b9a783c2534029610219dc Mon Sep 17 00:00:00 2001 From: Jiri Jaburek Date: Fri, 5 Apr 2024 21:00:40 +0200 Subject: [PATCH 1/3] add E306 flake8 ignores Signed-off-by: Jiri Jaburek --- setup.cfg | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 0ba0e79d..2bc404e9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,5 +17,11 @@ ; https://www.flake8rules.com/rules/W503.html ; freely admits, new code should use Knuth's notation, see also ; https://peps.python.org/pep-0008/#should-a-line-break-before-or-after-a-binary-operator -extend-ignore = E265,E226,E231,W503 +; E306 empty line between nested function declaration and its parent +; - this seems like a bad idea, all other code is fine to be written directly +; after the (parent) function declaration, so why not another 'def'? +; - allowing this arguably helps readability, as it allows condensed code +; to appear where it makes sense (tightly integrated nested 1-line functions) +; rather than having to 'foo = lambda x: something(x)' and breaking debug +extend-ignore = E265,E226,E231,W503,E306 max-line-length = 99 From 01f333a9f0a8f794b35b25aa1f45b5506bd6f368 Mon Sep 17 00:00:00 2001 From: Jiri Jaburek Date: Fri, 5 Apr 2024 21:03:53 +0200 Subject: [PATCH 2/3] add flake8 to Github actions Signed-off-by: Jiri Jaburek --- .github/workflows/sanity.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/sanity.yaml b/.github/workflows/sanity.yaml index ceaf413c..805172bc 100644 --- a/.github/workflows/sanity.yaml +++ b/.github/workflows/sanity.yaml @@ -23,3 +23,12 @@ jobs: print(str(e)) sys.exit(1) EOF + flake8: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install flake8 + run: python3 -m pip install flake8 + - name: Run flake8 + run: flake8 -v From 8fec66bd6d4ce49a43876518254e11a0e0db9ee0 Mon Sep 17 00:00:00 2001 From: Jiri Jaburek Date: Fri, 5 Apr 2024 21:35:39 +0200 Subject: [PATCH 3/3] add tmt-related sanity checks Signed-off-by: Jiri Jaburek --- .github/workflows/sanity.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/sanity.yaml b/.github/workflows/sanity.yaml index 805172bc..9b7dac3c 100644 --- a/.github/workflows/sanity.yaml +++ b/.github/workflows/sanity.yaml @@ -32,3 +32,14 @@ jobs: run: python3 -m pip install flake8 - name: Run flake8 run: flake8 -v + tmt: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install tmt + run: python3 -m pip install tmt + - name: Run tmt lint + run: tmt lint --failed-only + - name: Run basic tmt run discover + run: tmt run -v plans -n /plans/default discover -h fmf