File tree Expand file tree Collapse file tree 4 files changed +59
-7
lines changed Expand file tree Collapse file tree 4 files changed +59
-7
lines changed Original file line number Diff line number Diff line change @@ -51,17 +51,20 @@ jobs:
51
51
- name : Install project
52
52
run : poetry install --no-interaction
53
53
54
+ - name : Setup just
55
+ uses : taiki-e/install-action@just
56
+
54
57
- name : Enforce code style (Ruff)
55
- run : poetry run ruff check -- show-source --show-fixes .
58
+ run : just ruff- show-violations
56
59
57
60
- name : Verify code formatting (Black)
58
- run : poetry run black -- check --diff .
61
+ run : just black- check
59
62
60
63
- name : Run tests
61
- run : poetry run pytest --verbose
64
+ run : just test
62
65
63
66
- name : Generate test coverage report
64
- run : poetry run pytest --cov=./ -- cov-report=xml
67
+ run : just test-and-report- cov
65
68
66
69
- name : Upload coverage reports to Codecov
67
70
uses : codecov/codecov-action@v3
Original file line number Diff line number Diff line change @@ -13,12 +13,12 @@ repos:
13
13
hooks :
14
14
- id : ruff
15
15
name : ruff (linter)
16
- entry : poetry run ruff check .
16
+ entry : just ruff
17
17
language : system
18
18
types : [python]
19
19
args : [--fix]
20
20
- id : black
21
21
name : black
22
- entry : poetry run black .
22
+ entry : just black
23
23
language : system
24
24
types : [python]
Original file line number Diff line number Diff line change @@ -16,9 +16,9 @@ Personal attempt to solve the `advent-of-code`[^aoc] puzzles in a `TDD` fashion
16
16
### β οΈ TODO:
17
17
- Repo setup:
18
18
- π§ ~~ try out ` ruff ` as a linter, thus replacing ` flake8 ` ~~
19
+ - π§ ~~ ` makefile ` | ` justfile ` ~~
19
20
- π§ rely on a unique configuration file (possibly ` pyproject.toml ` )
20
21
- π§ add ` mypy ` (` --strict ` ?) in the pipeline
21
- - π§ ` makefile ` | ` justfile `
22
22
- π§ try out ` ruff ` as a formatter, thus replacing ` black ` ?
23
23
- π§ Dockerization?
24
24
- π§ else?
Original file line number Diff line number Diff line change
1
+ # Use PowerShell instead of sh
2
+ # set shell := ["powershell.exe", "-c"]
3
+
4
+ help :
5
+ @ just --list
6
+
7
+ install :
8
+ @ echo " π Installing dependencies"
9
+ @ poetry install --with dev
10
+
11
+ install-pre-commit :
12
+ @ echo " π Setting up the hooks"
13
+ @ poetry run pre-commit install
14
+
15
+ check-project :
16
+ @ echo " π Checking consistency between poetry.lock and pyproject.toml"
17
+ @ poetry check --lock
18
+ @ echo " π Running the hooks against all files"
19
+ @ poetry run pre-commit run --all-files
20
+
21
+ ruff :
22
+ @ echo " π Linting the project with Ruff"
23
+ @ poetry run ruff check src tests
24
+
25
+ ruff-show-violations :
26
+ @ echo " π Linting the project with Ruff and show violations"
27
+ @ poetry run ruff check --show-source --show-fixes src tests
28
+
29
+ ruff-fix :
30
+ @ echo " π Linting the project with Ruff and autofix violations (where possible)"
31
+ @ poetry run ruff check --fix src tests
32
+
33
+ black :
34
+ @ echo " π Formatting the code with Black"
35
+ @ poetry run black src tests
36
+
37
+ black-check :
38
+ @ echo " π Checking formatting advices from Black"
39
+ @ poetry run black --check --diff src tests
40
+
41
+ lint-and-format : ruff black
42
+
43
+ test :
44
+ @ echo " π Testing code with pytest"
45
+ @ poetry run pytest --verbose tests
46
+
47
+ test-and-report-cov :
48
+ @ echo " π Testing code with pytest and generating coverage report"
49
+ @ poetry run pytest --cov=./ --cov-report=xml
You canβt perform that action at this time.
0 commit comments