add container-based linting workflow using Forgejo Container Registry
This commit is contained in:
parent
508a9beec9
commit
c33e3aa9ac
2 changed files with 24 additions and 84 deletions
23
Makefile
23
Makefile
|
|
@ -20,10 +20,24 @@ test-coverage: ## Run tests with coverage
|
|||
python -m pytest tests/ --cov=deb_mock --cov-report=html --cov-report=term
|
||||
|
||||
lint: ## Run linting checks
|
||||
@echo "=== Running all linting checks with Docker container ==="
|
||||
docker run --rm -v $(PWD):/app git.raines.xyz/robojerk/deb-mock-linter:latest /bin/bash -c "\
|
||||
echo '=== Linting YAML files ===' && \
|
||||
yamllint .forgejo/workflows/ deb_mock/configs/ test-config.yaml && \
|
||||
echo '=== Linting Python files ===' && \
|
||||
source /opt/venv/bin/activate && \
|
||||
flake8 deb_mock/ tests/ --max-line-length=120 --ignore=E203,W503 && \
|
||||
black --check --line-length=120 deb_mock/ tests/ && \
|
||||
isort --check-only --profile=black deb_mock/ tests/ && \
|
||||
echo '=== Linting shell scripts ===' && \
|
||||
find . -name '*.sh' -exec shellcheck {} \; && \
|
||||
echo '✅ All linting checks passed!'"
|
||||
|
||||
lint-local: ## Run linting checks locally (requires tools installed)
|
||||
@echo "=== Running Python linting ==="
|
||||
flake8 deb_mock/ tests/ --max-line-length=120 --ignore=E203,W503
|
||||
black --check --line-length=120 deb_mock/ tests/
|
||||
isort --check-only --profile=black deb_mock/ tests/
|
||||
venv/bin/flake8 deb_mock/ tests/ --max-line-length=120 --ignore=E203,W503
|
||||
venv/bin/black --check --line-length=120 deb_mock/ tests/
|
||||
venv/bin/isort --check-only --profile=black deb_mock/ tests/
|
||||
@echo "=== Running YAML linting ==="
|
||||
yamllint .forgejo/workflows/ deb_mock/configs/ test-config.yaml
|
||||
@echo "=== Running shell linting ==="
|
||||
|
|
@ -50,7 +64,8 @@ install-system-deps: ## Install system dependencies (requires sudo)
|
|||
sudo apt install -y sbuild schroot debhelper build-essential debootstrap yamllint shellcheck
|
||||
|
||||
install-lint-deps: ## Install linting dependencies
|
||||
pip install flake8 black isort bandit
|
||||
python3 -m venv venv
|
||||
venv/bin/pip install flake8 black isort bandit
|
||||
sudo apt install -y yamllint shellcheck nodejs npm
|
||||
sudo npm install -g markdownlint-cli
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue