Skip to content

Pre commit linting

Eric Ford edited this page Nov 30, 2021 · 2 revisions

dbt-firebolt requires linting be done before commits can be merged. This linting involves:

  1. Check for merge conflicts
  2. setup-cfg-fmt to check .cfg file
  3. autoflake to remove unused imports
  4. isort to correctly order imports
  5. black
  6. flake8

All of these checks can be run locally by installing isort>=5.10 flake8>=4.0 black>=21.10 pre-commit==2.15.0

Support for running mypy and Pydantic is coming.

Specific setting can be found in setup.cfg, but the current dbt-firebolt specs are as follows:

  1. isort uses default settings
  2. Flake8, per Black suggestions:
    1. Ignores E203, dealing with : in list slices.
    2. Ignores W503, which deals with operator alignment.
    3. Ignores F401—ignore unused imports—on __init__.py files.
    4. Sets line length = 88.
  3. Black: prefer single quotes
Clone this wiki locally