File tree 6 files changed +154
-55
lines changed
6 files changed +154
-55
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
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-python-task.md
2
+ name : Check Python
3
+
4
+ env :
5
+ # See: https://github.com/actions/setup-python/tree/v2#available-versions-of-python
6
+ PYTHON_VERSION : " 3.9"
7
+
8
+ # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
9
+ on :
10
+ push :
11
+ paths :
12
+ - " .github/workflows/check-python-task.ya?ml"
13
+ - " **/.flake8"
14
+ - " **/poetry.lock"
15
+ - " **/pyproject.toml"
16
+ - " **/setup.cfg"
17
+ - " Taskfile.ya?ml"
18
+ - " **/tox.ini"
19
+ - " **.py"
20
+ pull_request :
21
+ paths :
22
+ - " .github/workflows/check-python-task.ya?ml"
23
+ - " **/.flake8"
24
+ - " **/poetry.lock"
25
+ - " **/pyproject.toml"
26
+ - " **/setup.cfg"
27
+ - " Taskfile.ya?ml"
28
+ - " **/tox.ini"
29
+ - " **.py"
30
+ workflow_dispatch :
31
+ repository_dispatch :
32
+
33
+ jobs :
34
+ lint :
35
+ runs-on : ubuntu-latest
36
+
37
+ steps :
38
+ - name : Checkout repository
39
+ uses : actions/checkout@v2
40
+
41
+ - name : Install Python
42
+ uses : actions/setup-python@v2
43
+ with :
44
+ python-version : ${{ env.PYTHON_VERSION }}
45
+
46
+ - name : Install Poetry
47
+ run : pip install poetry
48
+
49
+ - name : Install Task
50
+ uses : arduino/setup-task@v1
51
+ with :
52
+ repo-token : ${{ secrets.GITHUB_TOKEN }}
53
+ version : 3.x
54
+
55
+ - name : Run flake8
56
+ uses : liskin/gh-problem-matcher-wrap@v1
57
+ with :
58
+ linters : flake8
59
+ run : task python:lint
60
+
61
+ formatting :
62
+ runs-on : ubuntu-latest
63
+
64
+ steps :
65
+ - name : Checkout repository
66
+ uses : actions/checkout@v2
67
+
68
+ - name : Install Python
69
+ uses : actions/setup-python@v2
70
+ with :
71
+ python-version : ${{ env.PYTHON_VERSION }}
72
+
73
+ - name : Install Poetry
74
+ run : pip install poetry
75
+
76
+ - name : Install Task
77
+ uses : arduino/setup-task@v1
78
+ with :
79
+ repo-token : ${{ secrets.GITHUB_TOKEN }}
80
+ version : 3.x
81
+
82
+ - name : Format Python code
83
+ run : task python:format
84
+
85
+ - name : Check formatting
86
+ run : git diff --color --exit-code
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ includes:
4
4
dist : ./DistTasks.yml
5
5
6
6
tasks :
7
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml
7
8
poetry:install-deps :
8
9
desc : Install dependencies managed by Poetry
9
10
cmds :
@@ -190,16 +191,20 @@ tasks:
190
191
cmds :
191
192
- task : python:lint
192
193
194
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-python-task/Taskfile.yml
193
195
python:lint :
194
196
desc : Lint Python code
195
- cmds :
197
+ deps :
196
198
- task : poetry:install-deps
197
- - poetry run flake8
199
+ cmds :
200
+ - poetry run flake8 --show-source
198
201
202
+ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-python-task/Taskfile.yml
199
203
python:format :
200
- desc : Automatically formats Python files
201
- cmds :
204
+ desc : Format Python files
205
+ deps :
202
206
- task : poetry:install-deps
207
+ cmds :
203
208
- poetry run black .
204
209
205
210
vars :
Original file line number Diff line number Diff line change @@ -13,13 +13,14 @@ python-dateutil = "^2.8.1"
13
13
14
14
[tool .poetry .dev-dependencies ]
15
15
flake8 = " ^3.9.2"
16
- black = " ^21.5b1 "
16
+ black = " ^21.7b0 "
17
17
mkdocs = " ^1.2.1"
18
18
mkdocs-material = " ^7.1.8"
19
19
mdx-truly-sane-lists = " ^1.2"
20
20
click = " <7.2"
21
21
GitPython = " ^3.1.1"
22
22
mike = " ^1.0.1"
23
+ pep8-naming = " ^0.12.1"
23
24
24
25
[tool .black ]
25
26
line-length = 120
You can’t perform that action at this time.
0 commit comments