GRM-20: refactor: standardise pre-commit hooks on make targets
This commit is contained in:
@@ -8,25 +8,25 @@ repos:
|
|||||||
stages: [commit-msg]
|
stages: [commit-msg]
|
||||||
pass_filenames: true
|
pass_filenames: true
|
||||||
|
|
||||||
- id: ruff-lint
|
- id: lint-ruff
|
||||||
name: ruff lint
|
name: ruff lint
|
||||||
entry: .venv/bin/ruff check src/ tests/
|
entry: make lint-ruff
|
||||||
language: system
|
language: system
|
||||||
types: [python]
|
types: [python]
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
stages: [pre-commit]
|
stages: [pre-commit]
|
||||||
|
|
||||||
- id: ruff-format
|
- id: lint-format
|
||||||
name: ruff format check
|
name: ruff format check
|
||||||
entry: .venv/bin/ruff format --check src/ tests/
|
entry: make lint-format
|
||||||
language: system
|
language: system
|
||||||
types: [python]
|
types: [python]
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
stages: [pre-commit]
|
stages: [pre-commit]
|
||||||
|
|
||||||
- id: pyright
|
- id: typecheck
|
||||||
name: pyright type check
|
name: pyright type check
|
||||||
entry: .venv/bin/pyright
|
entry: make typecheck
|
||||||
language: system
|
language: system
|
||||||
types: [python]
|
types: [python]
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
@@ -34,7 +34,7 @@ repos:
|
|||||||
|
|
||||||
- id: ansible-lint
|
- id: ansible-lint
|
||||||
name: ansible-lint
|
name: ansible-lint
|
||||||
entry: .venv/bin/ansible-lint ansible/
|
entry: make ansible-lint
|
||||||
language: system
|
language: system
|
||||||
types: [yaml]
|
types: [yaml]
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
@@ -42,7 +42,7 @@ repos:
|
|||||||
|
|
||||||
- id: pytest-cov
|
- id: pytest-cov
|
||||||
name: pytest with 100% coverage
|
name: pytest with 100% coverage
|
||||||
entry: .venv/bin/pytest tests/unit/ --cov=src/gitea_runner_manager --cov=scripts --cov-report=term-missing --cov-fail-under=100
|
entry: make pytest-cov
|
||||||
language: system
|
language: system
|
||||||
types: [python]
|
types: [python]
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
|
|||||||
@@ -74,11 +74,17 @@ remove:
|
|||||||
@if [ -z "$(HOST)" ]; then echo "HOST is required. Example: make remove HOST=192.168.1.10"; exit 1; fi
|
@if [ -z "$(HOST)" ]; then echo "HOST is required. Example: make remove HOST=192.168.1.10"; exit 1; fi
|
||||||
$(BIN)/grm remove $(HOST) $(if $(USER),--user $(USER),) $(if $(NAME),--name $(NAME),) $(if $(TOKEN),--token $(TOKEN),) $(if $(MODE),--mode $(MODE),) $(if $(ASK_BECOME_PASS),--ask-become-pass,)
|
$(BIN)/grm remove $(HOST) $(if $(USER),--user $(USER),) $(if $(NAME),--name $(NAME),) $(if $(TOKEN),--token $(TOKEN),) $(if $(MODE),--mode $(MODE),) $(if $(ASK_BECOME_PASS),--ask-become-pass,)
|
||||||
|
|
||||||
lint:
|
lint-ruff:
|
||||||
$(BIN)/ruff check src/ tests/
|
$(BIN)/ruff check src/ tests/
|
||||||
|
|
||||||
|
lint-format:
|
||||||
$(BIN)/ruff format --check src/ tests/
|
$(BIN)/ruff format --check src/ tests/
|
||||||
|
|
||||||
|
typecheck:
|
||||||
$(BIN)/pyright
|
$(BIN)/pyright
|
||||||
|
|
||||||
|
lint: lint-ruff lint-format typecheck
|
||||||
|
|
||||||
ansible-lint:
|
ansible-lint:
|
||||||
$(BIN)/ansible-lint ansible/
|
$(BIN)/ansible-lint ansible/
|
||||||
|
|
||||||
@@ -94,7 +100,7 @@ test-integration:
|
|||||||
$(BIN)/pytest tests/integration/ -v --no-cov
|
$(BIN)/pytest tests/integration/ -v --no-cov
|
||||||
|
|
||||||
pytest-cov:
|
pytest-cov:
|
||||||
$(BIN)/pytest tests/unit/ -v --cov=src/gitea_runner_manager --cov-report=term-missing --cov-fail-under=100
|
$(BIN)/pytest tests/unit/ -v --cov=src/gitea_runner_manager --cov=scripts --cov-report=term-missing --cov-fail-under=100
|
||||||
|
|
||||||
MOLECULE := $(realpath $(BIN))/molecule
|
MOLECULE := $(realpath $(BIN))/molecule
|
||||||
MOLECULE_BASE := cd $(CURDIR)/ansible/roles/gitea-runner && ANSIBLE_ALLOW_BROKEN_CONDITIONALS=true $(MOLECULE)
|
MOLECULE_BASE := cd $(CURDIR)/ansible/roles/gitea-runner && ANSIBLE_ALLOW_BROKEN_CONDITIONALS=true $(MOLECULE)
|
||||||
|
|||||||
Reference in New Issue
Block a user