File tree 7 files changed +308
-304
lines changed
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
+
1
6
[flake8]
2
7
doctests = 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
7
10
max-complexity = 10
8
11
max-line-length = 120
9
12
select = 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 3
3
[ ![ Tests Status] ( https://github.com/arduino/arduino-lint/workflows/Run%20tests/badge.svg )] ( https://github.com/arduino/arduino-lint/actions?workflow=Run+tests )
4
4
[ ![ 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 )
5
5
[ ![ 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 )
6
7
[ ![ 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 )
7
8
[ ![ Docs Status] ( https://github.com/arduino/arduino-lint/workflows/Publish%20documentation/badge.svg )] ( https://github.com/arduino/arduino-lint/actions?workflow=Publish+documentation )
8
9
[ ![ 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:
165
165
'
166
166
fi
167
167
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
169
171
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
171
179
180
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-python-task/Taskfile.yml
172
181
python:lint :
173
182
desc : Lint Python code
183
+ deps :
184
+ - task : poetry:install-deps
174
185
cmds :
175
- - poetry install --no-root
176
- - poetry run flake8
186
+ - poetry run flake8 --show-source
177
187
188
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-python-task/Taskfile.yml
178
189
python:format :
179
- desc : Automatically formats Python files
190
+ desc : Format Python files
191
+ deps :
192
+ - task : poetry:install-deps
180
193
cmds :
181
- - poetry install --no-root
182
194
- poetry run black .
183
195
184
196
docs:generate :
You can’t perform that action at this time.
0 commit comments