Code Quality


The project uses a number of tools for code quality. The core tools are:

These are all managed by pre-commit. To get started, install pre-commit in your local environment. The configuration for this is in .pre-commit-config.yml

exclude: 'docs|node_modules|migrations|.git|.tox|static/css/app.css'
default_stages: [commit]

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.0.1
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer
      - id: check-yaml

  - repo: https://github.com/psf/black
    rev: 22.1.0
    hooks:
      - id: black

  - repo: https://github.com/pycqa/isort
    rev: 5.10.1
    hooks:
      - id: isort

  - repo: https://github.com/pycqa/flake8
    rev: 4.0.1
    hooks:
      - id: flake8

  - repo: https://github.com/rtts/djhtml
    rev: v1.4.11
    hooks:
      - id: djhtml
        args:
          - --tabwidth=2

After installation, the tool will run automatically when you commit to your git repo.

Run on all files

To run pre-commit on all files

$ pre-commit run --all-files

Copyright © 2022 www.advantch.com