diff --git a/.github/workflows/superset-python-misc.yml b/.github/workflows/superset-python-misc.yml index 57a5b7485..da9dc000b 100644 --- a/.github/workflows/superset-python-misc.yml +++ b/.github/workflows/superset-python-misc.yml @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b6b0ad85c..d59dfcbee 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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", + ] diff --git a/setup.py b/setup.py index 4a7247a3a..00b8d22e2 100644 --- a/setup.py +++ b/setup.py @@ -30,9 +30,9 @@ with open(PACKAGE_JSON) as package_file: 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 ""