Skip to content

Commit

Permalink
chore: add pylint to pre-commit hook (#28137)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch authored Apr 25, 2024
1 parent 2d63722 commit 7b40b64
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/superset-python-misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ jobs:
- name: Setup Python
uses: ./.github/actions/setup-backend/
if: steps.check.outputs.python
- name: pylint
if: steps.check.outputs.python
# `-j 0` run Pylint in parallel
run: pylint -j 0 superset

babel-extract:
runs-on: ubuntu-20.04
Expand Down
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,17 @@ repos:
- id: ruff
args: [ --fix ]
- id: ruff-format
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
exclude: ^(tests/|superset/migrations/|scripts/|RELEASING/|docker/)
args:
[
"-rn", # Only display messages
"-sn", # Don't display the score
"--rcfile=.pylintrc",
]
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@

def get_git_sha() -> str:
try:
s = subprocess.check_output(["git", "rev-parse", "HEAD"])
return s.decode().strip()
except Exception:
output = subprocess.check_output(["git", "rev-parse", "HEAD"])
return output.decode().strip()
except Exception: # pylint: disable=broad-except
return ""


Expand Down

0 comments on commit 7b40b64

Please sign in to comment.