chore: add pylint to pre-commit hook (#28137)
This commit is contained in:
parent
2d63722150
commit
7b40b6426c
|
|
@ -31,10 +31,6 @@ jobs:
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: ./.github/actions/setup-backend/
|
uses: ./.github/actions/setup-backend/
|
||||||
if: steps.check.outputs.python
|
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:
|
babel-extract:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
|
|
||||||
|
|
@ -77,3 +77,17 @@ repos:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
args: [ --fix ]
|
args: [ --fix ]
|
||||||
- id: ruff-format
|
- 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
setup.py
6
setup.py
|
|
@ -30,9 +30,9 @@ with open(PACKAGE_JSON) as package_file:
|
||||||
|
|
||||||
def get_git_sha() -> str:
|
def get_git_sha() -> str:
|
||||||
try:
|
try:
|
||||||
s = subprocess.check_output(["git", "rev-parse", "HEAD"])
|
output = subprocess.check_output(["git", "rev-parse", "HEAD"])
|
||||||
return s.decode().strip()
|
return output.decode().strip()
|
||||||
except Exception:
|
except Exception: # pylint: disable=broad-except
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue