Skip to main content
Edit this page on GitHub

Git Hooks

Superset uses Git pre-commit hooks courtesy of pre-commit. To install run the following:

pip3 install -r requirements/development.txt
pre-commit install

A series of checks will now run when you make a git commit.

Alternatively it is possible to run pre-commit via tox:

tox -e pre-commit

Or by running pre-commit manually:

pre-commit run --all-files

Linting

Python

We use Pylint for linting which can be invoked via:

# for python
tox -e pylint

In terms of best practices please avoid blanket disabling of Pylint messages globally (via .pylintrc) or top-level within the file header, albeit there being a few exceptions. Disabling should occur inline as it prevents masking issues and provides context as to why said message is disabled.

Additionally, the Python code is auto-formatted using Black which is configured as a pre-commit hook. There are also numerous editor integrations

TypeScript

cd superset-frontend
npm ci
# run eslint checks
npm run eslint -- .
# run tsc (typescript) checks
npm run type

If using the eslint extension with vscode, put the following in your workspace settings.json file:

"eslint.workingDirectories": [
"superset-frontend"
]