1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-08 11:16:47 +00:00

ci: replace super-linter with ruff

Super-linter ran from the unpinned :latest image and, because of
branches-ignore: [master], never on pull requests to master. Ruff now
checks syntax errors and pyflakes rules (E9, F) on every push and PR.

Fixes the existing findings: unused imports and variables, an unused
duplicate import in instances/tests.py, and the star import in
accounts/views.py. settings-dev.py keeps its star import of the base
settings.
This commit is contained in:
catborise 2026-10-03 12:26:00 +03:00
parent a8725ee325
commit b04f656d2b
31 changed files with 37 additions and 114 deletions

View file

@ -1,92 +1,27 @@
###########################
###########################
## Linter GitHub Actions ##
###########################
###########################
name: Lint
name: Lint Code Base
#
# Documentation:
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
#
#############################
# Start the job on all push #
#############################
on:
push:
branches: [master]
pull_request:
branches-ignore: [master]
branches: [master]
###############
# Set the Job #
###############
jobs:
build:
name: Lint Code Base
# Set the agent to run on
ruff:
name: Ruff
runs-on: ubuntu-latest
##################
# Load all steps #
###################
steps:
##########################
# Checkout the code base #
##########################
- name: Checkout Code
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Required packages
run: |
sudo apt-get update -qq
sudo apt-get install -y python3-venv python3-virtualenv libvirt-dev libldap2-dev libsasl2-dev python3-lxml zlib1g-dev libxslt1-dev pkg-config gcc libssl-dev
- name: Create & Activate VENV
run: |
python3 -m venv venv
echo "$GITHUB_WORKSPACE/venv/bin" >> "$GITHUB_PATH"
- name: Install dependencies
run: |
pip3 install --upgrade pip setuptools wheel
if [ -f dev/requirements.txt ]; then pip3 install -r dev/requirements.txt; else pip3 install -r conf/requirements.txt; fi
################################
# Run Linter against code base #
################################
- name: Lint Code Base
uses: docker://github/super-linter:latest
env:
FILTER_REGEX_EXCLUDE: .*(static|scss|venv|locale|templates)/.*
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_ALL_CODEBASE: false
VALIDATE_MARKDOWN: false
VALIDATE_HTML: false
VALIDATE_JSCPD: false
VALIDATE_ANSIBLE: false
VALIDATE_CLOJURE: false
VALIDATE_COFFEE: false
VALIDATE_DART: false
VALIDATE_GO: false
VALIDATE_JSX: false
VALIDATE_KOTLIN: false
VALIDATE_POWERSHELL: false
VALIDATE_PERL: false
VALIDATE_PHP: false
VALIDATE_RAKU: false
VALIDATE_RUBY: false
VALIDATE_TSX: false
VALIDATE_TERRAFORM: false
# Same ruff version as dev/requirements.txt
- name: Install Ruff
run: pip install "$(grep '^ruff==' dev/requirements.txt)"
- name: Run Ruff
run: ruff check --output-format=github .