File tree 12 files changed +640
-1
lines changed
12 files changed +640
-1
lines changed Original file line number Diff line number Diff line change
1
+ [flake8]
2
+ 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
7
+ max-complexity = 10
8
+ max-line-length = 120
9
+ select = E,W,F,C,N
Original file line number Diff line number Diff line change
1
+ name : Check General Formatting
2
+
3
+ # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
4
+ on :
5
+ push :
6
+ pull_request :
7
+ schedule :
8
+ # Run every Tuesday at 8 AM UTC to catch breakage caused by changes to tools.
9
+ - cron : " 0 8 * * TUE"
10
+ workflow_dispatch :
11
+ repository_dispatch :
12
+
13
+ jobs :
14
+ check :
15
+ runs-on : ubuntu-latest
16
+
17
+ steps :
18
+ - name : Checkout repository
19
+ uses : actions/checkout@v2
20
+
21
+ - name : Check formatting
22
+ uses :
editorconfig-checker/[email protected]
Original file line number Diff line number Diff line change
1
+ name : Lint Python code
2
+
3
+ on :
4
+ push :
5
+ paths :
6
+ - " **.py"
7
+ - " .flake8"
8
+ - " pyproject.toml"
9
+ - " Taskfile.yml"
10
+ pull_request :
11
+ paths :
12
+ - " **.py"
13
+ - " .flake8"
14
+ - " pyproject.toml"
15
+ - " Taskfile.yml"
16
+
17
+ jobs :
18
+ lint-python :
19
+ runs-on : ubuntu-latest
20
+
21
+ steps :
22
+ - name : Checkout
23
+ uses : actions/checkout@v2
24
+
25
+ - name : Install Taskfile
26
+ uses : arduino/setup-task@v1
27
+ with :
28
+ repo-token : ${{ secrets.GITHUB_TOKEN }}
29
+ version : 3.x
30
+
31
+ - name : Install Python
32
+ uses : actions/setup-python@v2
33
+ with :
34
+ python-version : " 3.8"
35
+
36
+ - name : Install Poetry
37
+ run : pip install poetry
38
+
39
+ - name : Lint Python files
40
+ run : task python:check
Original file line number Diff line number Diff line change 48
48
GOARCH : " arm"
49
49
run : task build
50
50
51
- - name : Run unit tests
51
+ - name : Install Python
52
+ uses : actions/setup-python@v2
53
+ with :
54
+ python-version : " 3.8"
55
+
56
+ - name : Install Poetry
57
+ run : pip install poetry
58
+
59
+ - name : Run unit and integration tests
52
60
run : task test
Original file line number Diff line number Diff line change 4
4
.idea
5
5
coverage_ * .txt
6
6
/dist
7
+ __pycache__ /
7
8
8
9
# Misc.
9
10
.DS_Store
Original file line number Diff line number Diff line change @@ -33,9 +33,22 @@ tasks:
33
33
34
34
test :
35
35
desc : Run tests
36
+ cmds :
37
+ - task : test-unit
38
+ - task : test-integration
39
+
40
+ test-unit :
41
+ desc : Run unit tests
36
42
cmds :
37
43
- go test -short -race -run '.*' {{ default "-v" .GOFLAGS }} -coverprofile=coverage_unit.txt ./... {{.TEST_LDFLAGS}}
38
44
45
+ test-integration :
46
+ desc : Run integration tests
47
+ cmds :
48
+ - task : build
49
+ - poetry install --no-root
50
+ - poetry run pytest test
51
+
39
52
check :
40
53
desc : Check fmt and lint
41
54
cmds :
44
57
- " '{{.GOLINTBIN}}' {{.GOLINTFLAGS}} ./..."
45
58
- task : docs:check
46
59
- task : config:check
60
+ - task : python:check
47
61
48
62
config:check :
49
63
desc : Check linting of configuration and supporting files
@@ -55,6 +69,22 @@ tasks:
55
69
cmds :
56
70
- npx {{ .PRETTIER }} --write "**/*.{yml,yaml}"
57
71
72
+ python:check :
73
+ cmds :
74
+ - task : python:lint
75
+
76
+ python:lint :
77
+ desc : Lint Python code
78
+ cmds :
79
+ - poetry install --no-root
80
+ - poetry run flake8
81
+
82
+ python:format :
83
+ desc : Automatically formats Python files
84
+ cmds :
85
+ - poetry install --no-root
86
+ - poetry run black .
87
+
58
88
vars :
59
89
PROJECT_NAME : " FirmwareUploader"
60
90
DIST_DIR : " dist"
Original file line number Diff line number Diff line change @@ -307,6 +307,7 @@ golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTk
307
307
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3 /go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc =
308
308
golang.org/x/lint v0.0.0-20190409202823-959b441ac422 /go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc =
309
309
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac /go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc =
310
+ golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs =
310
311
golang.org/x/lint v0.0.0-20190930215403-16217165b5de /go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc =
311
312
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6 /go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE =
312
313
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 /go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o =
You can’t perform that action at this time.
0 commit comments