chore: add pylint rule for SQL importing (SIP-117) (#26803)

This commit is contained in:
Beto Dealmeida
2025-06-16 11:53:30 -07:00
committed by GitHub
parent 9df990c2d1
commit 527c8de773
5 changed files with 430 additions and 6 deletions

View File

@@ -100,3 +100,22 @@ repos:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: local
hooks:
- id: pylint
name: pylint with custom Superset plugins
entry: bash
language: system
types: [python]
exclude: ^(tests/|superset/migrations/|scripts/|RELEASING/|docker/)
args:
- -c
- |
TARGET_BRANCH=${GITHUB_BASE_REF:-master}
git fetch origin "$TARGET_BRANCH"
files=$(git diff --name-only --diff-filter=ACM origin/"$TARGET_BRANCH"..HEAD | grep '^superset/.*\.py$' || true)
if [ -n "$files" ]; then
pylint --rcfile=.pylintrc --load-plugins=superset.extensions.pylint $files
else
echo "No Python files to lint."
fi