Skip to content

Commit 9bf5073

Browse files
committed
feat(Makefile): Add Python "tidy" and "test-with-coverage"
1 parent ad40576 commit 9bf5073

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ test-unit: test-bash test-python
3333
test-bash: $(BPAN)
3434
"${PROVE}" -r $(if $v,-v )$(test)
3535

36+
.PHONY: test-python
3637
test-python:
3738
py.test tests
3839

@@ -47,6 +48,11 @@ checkstyle: test-shellcheck test-yaml checkstyle-python check-code-health
4748
shfmt:
4849
shfmt -w ${SH_FILES}
4950

51+
.PHONY: tidy
52+
tidy:
53+
ruff format
54+
ruff check --fix
55+
5056
test-shellcheck:
5157
@which shfmt >/dev/null 2>&1 || echo "Command 'shfmt' not found, can not execute shell script formating checks"
5258
shfmt -d ${SH_FILES}
@@ -57,8 +63,10 @@ test-yaml:
5763
@which yamllint >/dev/null 2>&1 || echo "Command 'yamllint' not found, can not execute YAML syntax checks"
5864
yamllint --strict $$(git ls-files "*.yml" "*.yaml" ":!external/")
5965

66+
.PHONY: checkstyle-python
6067
checkstyle-python: check-ruff check-conventions
6168
check-ruff:
69+
6270
@which ruff >/dev/null 2>&1 || echo "Command 'ruff' not found, can not execute python style checks"
6371
ruff check
6472
ruff format --check
@@ -74,6 +82,10 @@ check-code-health:
7482
@echo "Checking code health…"
7583
@vulture $$(git ls-files "**.py") --min-confidence 80
7684

85+
.PHONY: test-with-coverage
86+
test-with-coverage:
87+
pytest --cov=src/os-autoinst-scripts tests/
88+
7789
update-deps:
7890
tools/update-deps --cpanfile cpanfile --specfile dist/rpm/os-autoinst-scripts-deps.spec
7991

0 commit comments

Comments
 (0)