File tree Expand file tree Collapse file tree 7 files changed +308
-304
lines changed Expand file tree Collapse file tree 7 files changed +308
-304
lines changed Original file line number Diff line number Diff line change 1+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-python/.flake8
2+ # See: https://flake8.pycqa.org/en/latest/user/configuration.html
3+ # The code style defined in this file is the official standardized style to be used in all Arduino tooling projects and
4+ # should not be modified.
5+
16[flake8]
27doctests = True
3- ignore =
4- # W503 and W504 are mutually exclusive, so one or the other must be ignored.
5- # PEP 8 recommends line break before, so we keep W504.
6- W503
8+ # W503 and W504 are mutually exclusive. PEP 8 recommends line break before.
9+ ignore = W503
710max-complexity = 10
811max-line-length = 120
912select = E,W,F,C,N
Original file line number Diff line number Diff line change 1+ name : Check Python
2+
3+ env :
4+ # See: https://github.com/actions/setup-python/tree/v2#available-versions-of-python
5+ PYTHON_VERSION : " 3.8"
6+
7+ # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
8+ on :
9+ push :
10+ paths :
11+ - " .github/workflows/check-python-task.ya?ml"
12+ - " **/.flake8"
13+ - " **/poetry.lock"
14+ - " **/pyproject.toml"
15+ - " **/setup.cfg"
16+ - " Taskfile.ya?ml"
17+ - " **/tox.ini"
18+ - " **.py"
19+ pull_request :
20+ paths :
21+ - " .github/workflows/check-python-task.ya?ml"
22+ - " **/.flake8"
23+ - " **/poetry.lock"
24+ - " **/pyproject.toml"
25+ - " **/setup.cfg"
26+ - " Taskfile.ya?ml"
27+ - " **/tox.ini"
28+ - " **.py"
29+ workflow_dispatch :
30+ repository_dispatch :
31+
32+ jobs :
33+ lint :
34+ runs-on : ubuntu-latest
35+
36+ steps :
37+ - name : Checkout repository
38+ uses : actions/checkout@v2
39+
40+ - name : Install Python
41+ uses : actions/setup-python@v2
42+ with :
43+ python-version : ${{ env.PYTHON_VERSION }}
44+
45+ - name : Install Poetry
46+ run : pip install poetry
47+
48+ - name : Install Task
49+ uses : arduino/setup-task@v1
50+ with :
51+ repo-token : ${{ secrets.GITHUB_TOKEN }}
52+ version : 3.x
53+
54+ - name : Run flake8
55+ uses : liskin/gh-problem-matcher-wrap@v1
56+ with :
57+ linters : flake8
58+ run : task python:lint
59+
60+ formatting :
61+ runs-on : ubuntu-latest
62+
63+ steps :
64+ - name : Checkout repository
65+ uses : actions/checkout@v2
66+
67+ - name : Install Python
68+ uses : actions/setup-python@v2
69+ with :
70+ python-version : ${{ env.PYTHON_VERSION }}
71+
72+ - name : Install Poetry
73+ run : pip install poetry
74+
75+ - name : Install Task
76+ uses : arduino/setup-task@v1
77+ with :
78+ repo-token : ${{ secrets.GITHUB_TOKEN }}
79+ version : 3.x
80+
81+ - name : Format Python code
82+ run : task python:format
83+
84+ - name : Check formatting
85+ run : git diff --color --exit-code
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 33[ ![ Tests Status] ( https://github.com/arduino/arduino-lint/workflows/Run%20tests/badge.svg )] ( https://github.com/arduino/arduino-lint/actions?workflow=Run+tests )
44[ ![ Check Go status] ( https://github.com/arduino/arduino-lint/actions/workflows/check-go-task.yml/badge.svg )] ( https://github.com/arduino/arduino-lint/actions/workflows/check-go-task.yml )
55[ ![ Nightly Status] ( https://github.com/arduino/arduino-lint/workflows/Nightly%20build/badge.svg )] ( https://github.com/arduino/arduino-lint/actions?workflow=Nightly+build )
6+ [ ![ Check Python status] ( https://github.com/arduino/arduino-lint/actions/workflows/check-python-task.yml/badge.svg )] ( https://github.com/arduino/arduino-lint/actions/workflows/check-python-task.yml )
67[ ![ Check Markdown status] ( https://github.com/arduino/arduino-lint/actions/workflows/check-markdown-task.yml/badge.svg )] ( https://github.com/arduino/arduino-lint/actions/workflows/check-markdown-task.yml )
78[ ![ Docs Status] ( https://github.com/arduino/arduino-lint/workflows/Publish%20documentation/badge.svg )] ( https://github.com/arduino/arduino-lint/actions?workflow=Publish+documentation )
89[ ![ Codecov] ( https://codecov.io/gh/arduino/arduino-lint/branch/main/graph/badge.svg?token=nprqPQMbdh )] ( https://codecov.io/gh/arduino/arduino-lint )
Original file line number Diff line number Diff line change @@ -165,20 +165,32 @@ tasks:
165165 '
166166 fi
167167
168- python:check :
168+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml
169+ poetry:install-deps :
170+ desc : Install dependencies managed by Poetry
169171 cmds :
170- - task : python:lint
172+ - poetry install --no-root
173+
174+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml
175+ poetry:update-deps :
176+ desc : Update all dependencies managed by Poetry to their newest versions
177+ cmds :
178+ - poetry update
171179
180+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-python-task/Taskfile.yml
172181 python:lint :
173182 desc : Lint Python code
183+ deps :
184+ - task : poetry:install-deps
174185 cmds :
175- - poetry install --no-root
176- - poetry run flake8
186+ - poetry run flake8 --show-source
177187
188+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-python-task/Taskfile.yml
178189 python:format :
179- desc : Automatically formats Python files
190+ desc : Format Python files
191+ deps :
192+ - task : poetry:install-deps
180193 cmds :
181- - poetry install --no-root
182194 - poetry run black .
183195
184196 docs:generate :
You can’t perform that action at this time.
0 commit comments