-
Notifications
You must be signed in to change notification settings - Fork 4
Linters reusable workflow #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| name: Linters | ||
|
|
||
| on: | ||
| push: | ||
| branches: ["master"] | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| lint: | ||
| uses: RedHatInsights/processing-tools/.github/workflows/linters.yaml@v0.1.0 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,36 +1,57 @@ | ||
| exclude: "doc|research|demos" | ||
| repos: | ||
| - repo: https://github.com/psf/black | ||
| rev: 26.3.1 | ||
| hooks: | ||
| - id: black | ||
| args: [--safe, --quiet, --line-length, "100"] | ||
| language_version: python3.11 | ||
| require_serial: true | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v6.0.0 | ||
| hooks: | ||
| - id: trailing-whitespace | ||
| language_version: python3.11 | ||
| - id: end-of-file-fixer | ||
| language_version: python3.11 | ||
| - id: check-yaml | ||
| language_version: python3.11 | ||
| - id: debug-statements | ||
| language_version: python3.11 | ||
| - repo: https://github.com/asottile/pyupgrade | ||
| rev: v3.21.2 | ||
| hooks: | ||
| - id: pyupgrade | ||
| language_version: python3.11 | ||
| - repo: https://github.com/PyCQA/flake8 | ||
| rev: 7.3.0 | ||
| hooks: | ||
| - id: flake8 | ||
| language_version: python3.11 | ||
| args: [--extend-ignore=E501] | ||
| - repo: https://gitlab.com/pycqa/pydocstyle | ||
| rev: 6.1.1 | ||
| hooks: | ||
| - id: pydocstyle | ||
| language_version: python3.11 | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v6.0.0 | ||
| hooks: | ||
| - id: end-of-file-fixer | ||
| - id: trailing-whitespace | ||
| - id: check-json | ||
| - id: check-toml | ||
| - id: check-yaml | ||
| - id: debug-statements | ||
| - id: mixed-line-ending | ||
| - id: check-ast | ||
| - id: check-merge-conflict | ||
| - id: check-added-large-files | ||
|
|
||
| - repo: https://github.com/shellcheck-py/shellcheck-py | ||
| rev: v0.11.0.1 | ||
| hooks: | ||
| - id: shellcheck | ||
| # Exclude checks that are commonly problematic in organization scripts | ||
| # SC1090: Can't follow non-constant source (dynamic sourcing) | ||
| # SC2086: Double quote to prevent globbing (intentional word splitting) | ||
| # SC2034: Variable appears unused (used by sourced scripts) | ||
| # SC1091: Not following included files (dynamic includes) | ||
| args: ['--exclude=SC1090,SC2086,SC2034,SC1091'] | ||
|
|
||
| - repo: https://github.com/golangci/golangci-lint | ||
| rev: v2.11.3 | ||
| hooks: | ||
| - id: golangci-lint-config-verify | ||
| - id: golangci-lint-full | ||
|
|
||
| - repo: https://github.com/RedHatInsights/processing-tools | ||
joselsegura marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| rev: v0.1.0 | ||
| hooks: | ||
| - id: abcgo | ||
| args: ['--threshold=64'] | ||
|
|
||
| - id: go-version-consistency | ||
|
|
||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.15.5 | ||
| hooks: | ||
| # Adding a set of rules to ruff check to match pyupgrade rules | ||
| - id: ruff-check | ||
| language_version: python3.11 | ||
| args: | ||
| - '--fix' | ||
| - '--line-length=100' | ||
| - '--select=UP,F632,E,W,F,I,UP,N,B,C4,SIM,D' | ||
| - id: ruff-format | ||
|
|
||
|
Comment on lines
+46
to
+52
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# Inspect whether Ruff settings are already centralized elsewhere.
fd -HI 'pyproject\.toml|ruff\.toml|\.ruff\.toml' | while read -r file; do
echo "== $file =="
rg -n '(\[tool\.ruff|\[lint|\[format|line-length|select)' "$file" || true
doneRepository: RedHatInsights/ccx-upgrades-data-eng Length of output: 189 🏁 Script executed: cat -n pyproject.tomlRepository: RedHatInsights/ccx-upgrades-data-eng Length of output: 445 🏁 Script executed: cat -n ruff.tomlRepository: RedHatInsights/ccx-upgrades-data-eng Length of output: 1381 Pre-commit Ruff configuration is out of sync with centralized ruff.toml. The Update 🤖 Prompt for AI Agents |
||
| # - repo: https://github.com/AleksaC/hadolint-py | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. any reason to keep this commented out?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I keep commented all of those that are in the "template" in the processing-tools repo, but are not easily fixable. Hadolint would require another task to be fixed, because we have warning in all our repositories |
||
| # rev: v2.14.0 | ||
| # hooks: | ||
| # - id: hadolint | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switch the push trigger to
main.Line 5 still points at
master, but this PR is targetingmain. After merge, pushes tomainwon't execute the lint workflow.Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents