Skip to content
Snippets Groups Projects
Commit dc382a1f authored by Dylan Aïssi's avatar Dylan Aïssi
Browse files

Improve lint job to check only python scripts

parent 081b1732
Branches apertis/v2025pre apertis/v2026dev0
Tags apertis/0.2024.15
1 merge request!84Enable lint job for python scripts in tools/
......@@ -3,17 +3,26 @@ lint:
image: debian:bookworm-slim
tags:
- lightweight
variables:
FILES: tools/
script:
before_script:
- apt update
- apt install --no-install-recommends -y
black
flake8
isort
- isort $FILES --check-only --diff
- black $FILES --check --diff
- flake8 $FILES
script:
- TOOLS=$(find tools/ -type f | sort)
- |
for SCRIPT in $TOOLS
do
GREP_PYTHON=$(grep '^#!/usr/bin/.*python' $SCRIPT || true)
if [ ! -z "$GREP_PYTHON" ]
then
PYTHON_SCRIPTS="$PYTHON_SCRIPTS $SCRIPT"
fi
done
- isort --profile black $PYTHON_SCRIPTS --check-only --diff
- black $PYTHON_SCRIPTS --check --diff
- flake8 $PYTHON_SCRIPTS
needs:
- pipeline: $PARENT_PIPELINE_ID
job: prepare-build-env
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment