File tree 7 files changed +339
-4
lines changed
workflow-templates/assets/test-integration
7 files changed +339
-4
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
+
6
+ [flake8]
7
+ doctests = True
8
+ # W503 and W504 are mutually exclusive. PEP 8 recommends line break before.
9
+ ignore = W503
10
+ max-complexity = 10
11
+ max-line-length = 120
12
+ select = E,W,F,C,N
Original file line number Diff line number Diff line change
1
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-python-task.md
2
+ name : Check Python
3
+
4
+ # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
5
+ on :
6
+ push :
7
+ paths :
8
+ - " .github/workflows/check-python-task.ya?ml"
9
+ - " **/.flake8"
10
+ - " **/poetry.lock"
11
+ - " **/pyproject.toml"
12
+ - " **/setup.cfg"
13
+ - " Taskfile.ya?ml"
14
+ - " **/tox.ini"
15
+ - " **.py"
16
+ pull_request :
17
+ paths :
18
+ - " .github/workflows/check-python-task.ya?ml"
19
+ - " **/.flake8"
20
+ - " **/poetry.lock"
21
+ - " **/pyproject.toml"
22
+ - " **/setup.cfg"
23
+ - " Taskfile.ya?ml"
24
+ - " **/tox.ini"
25
+ - " **.py"
26
+ workflow_dispatch :
27
+ repository_dispatch :
28
+
29
+ jobs :
30
+ lint :
31
+ runs-on : ubuntu-latest
32
+
33
+ steps :
34
+ - name : Checkout repository
35
+ uses : actions/checkout@v2
36
+
37
+ - name : Install Python
38
+ uses : actions/setup-python@v2
39
+ with :
40
+ python-version : " 3.9"
41
+
42
+ - name : Install Poetry
43
+ run : pip install poetry
44
+
45
+ - name : Install Task
46
+ uses : arduino/setup-task@v1
47
+ with :
48
+ repo-token : ${{ secrets.GITHUB_TOKEN }}
49
+ version : 3.x
50
+
51
+ - name : Run flake8
52
+ run : task python:lint
53
+
54
+ formatting :
55
+ runs-on : ubuntu-latest
56
+
57
+ steps :
58
+ - name : Checkout repository
59
+ uses : actions/checkout@v2
60
+
61
+ - name : Install Python
62
+ uses : actions/setup-python@v2
63
+ with :
64
+ python-version : " 3.9"
65
+
66
+ - name : Install Poetry
67
+ run : pip install poetry
68
+
69
+ - name : Install Task
70
+ uses : arduino/setup-task@v1
71
+ with :
72
+ repo-token : ${{ secrets.GITHUB_TOKEN }}
73
+ version : 3.x
74
+
75
+ - name : Format Python code
76
+ run : task python:format
77
+
78
+ - name : Check formatting
79
+ run : git diff --color --exit-code
Original file line number Diff line number Diff line change 13
13
[ ![ Sync Labels status] ( https://github.com/arduino/tooling-project-assets/actions/workflows/sync-labels.yml/badge.svg )] ( https://github.com/arduino/tooling-project-assets/actions/workflows/sync-labels.yml )
14
14
[ ![ Check Workflows status] ( https://github.com/arduino/tooling-project-assets/actions/workflows/check-workflows-task.yml/badge.svg )] ( https://github.com/arduino/tooling-project-assets/actions/workflows/check-workflows-task.yml )
15
15
[ ![ Spell Check status] ( https://github.com/arduino/tooling-project-assets/actions/workflows/spell-check-task.yml/badge.svg )] ( https:/github.com/arduino/tooling-project-assets/actions/workflows/spell-check-task.yml )
16
+ [ ![ Check Python status] ( https://github.com/arduino/tooling-project-assets/actions/workflows/check-python-task.yml/badge.svg )] ( https://github.com/arduino/tooling-project-assets/actions/workflows/check-python-task.yml )
16
17
17
18
The [ Arduino] ( https://www.arduino.cc/ ) Tooling Team's collection of reusable project infrastructure assets.
18
19
Original file line number Diff line number Diff line change @@ -214,6 +214,22 @@ tasks:
214
214
cmds :
215
215
- poetry update
216
216
217
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-python-task/Taskfile.yml
218
+ python:lint :
219
+ desc : Lint Python code
220
+ deps :
221
+ - task : poetry:install-deps
222
+ cmds :
223
+ - poetry run flake8 --show-source
224
+
225
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-python-task/Taskfile.yml
226
+ python:format :
227
+ desc : Format Python files
228
+ deps :
229
+ - task : poetry:install-deps
230
+ cmds :
231
+ - poetry run black .
232
+
217
233
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-yaml-task/Taskfile.yml
218
234
yaml:lint :
219
235
desc : Check for problems with YAML files
You can’t perform that action at this time.
0 commit comments