GRM-23: fix: improve make setup with version guard, pre-push hooks and commit-msg validator
This commit is contained in:
@@ -1,6 +1,13 @@
|
|||||||
repos:
|
repos:
|
||||||
- repo: local
|
- repo: local
|
||||||
hooks:
|
hooks:
|
||||||
|
- id: validate-commit-msg
|
||||||
|
name: validate commit message
|
||||||
|
entry: python3 scripts/validate_commit_msg.py
|
||||||
|
language: system
|
||||||
|
stages: [commit-msg]
|
||||||
|
pass_filenames: true
|
||||||
|
|
||||||
- id: ruff-lint
|
- id: ruff-lint
|
||||||
name: ruff lint
|
name: ruff lint
|
||||||
entry: .venv/bin/ruff check src/ tests/
|
entry: .venv/bin/ruff check src/ tests/
|
||||||
|
|||||||
@@ -12,7 +12,16 @@ setup: $(VENV)/bin/activate .env activate-scripts checkmake
|
|||||||
$(BIN)/ansible-galaxy collection install -r ansible/requirements.yml
|
$(BIN)/ansible-galaxy collection install -r ansible/requirements.yml
|
||||||
$(BIN)/pre-commit install
|
$(BIN)/pre-commit install
|
||||||
$(BIN)/pre-commit install --hook-type commit-msg
|
$(BIN)/pre-commit install --hook-type commit-msg
|
||||||
@echo "Setup complete. Activate the virtual environment with: source .venv/bin/activate"
|
$(BIN)/pre-commit install --hook-type pre-push
|
||||||
|
@echo ""
|
||||||
|
@echo "Setup complete."
|
||||||
|
@echo "Activate the virtual environment with one of:"
|
||||||
|
@echo " source .venv/bin/activate (generic)"
|
||||||
|
@echo " source activate.sh (bash)"
|
||||||
|
@echo " source activate.fish (fish)"
|
||||||
|
@echo " source activate.zsh (zsh)"
|
||||||
|
@-$(BIN)/grm --version
|
||||||
|
@-$(BIN)/pre-commit --version
|
||||||
|
|
||||||
.env:
|
.env:
|
||||||
@if [ ! -f .env ]; then \
|
@if [ ! -f .env ]; then \
|
||||||
@@ -21,6 +30,7 @@ setup: $(VENV)/bin/activate .env activate-scripts checkmake
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
$(VENV)/bin/activate:
|
$(VENV)/bin/activate:
|
||||||
|
@python3 -c "import sys; v=sys.version_info; assert v >= (3, 11), f'Python 3.11+ required, found {v.major}.{v.minor}'; print(f'Python {v.major}.{v.minor}.{v.micro} OK')"
|
||||||
$(PYTHON) -m venv $(VENV)
|
$(PYTHON) -m venv $(VENV)
|
||||||
$(BIN)/pip install --upgrade pip setuptools wheel
|
$(BIN)/pip install --upgrade pip setuptools wheel
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user