Skip to content

Add Linting and auto formatting #6

@eftsung

Description

@eftsung

The idea is to use linting/auto formatting tools on any new file and recently merged test code files.

Tools to employ:
black, flake8, isort, pylint

We'd like to

  • Add these to the poetry dev environment
  • Have them run automatically after every commit. The .pre-commit-config.yaml could look like
repos:
  - repo: https://github.com/psf/black
    rev: <version> # Use the appropriate version
    hooks:
      - id: black
  - repo: https://github.com/PyCQA/flake8
    rev: <version>
    hooks:
      - id: flake8
  - repo: https://github.com/PyCQA/isort
    rev: <version>
    hooks:
      - id: isort
  - repo: https://github.com/PyCQA/pylint
    rev: <version>
    hooks:
      - id: pylint
exclude: |
    (?x)^(
        (data|models)/.*|
        utils/(
            flags.py|
            gpu_live_plot.py|
            optimizer.py|
            plot_val_acc_from_logfile.py|
            utils.py|
            zero_redundancy_optimizer.py
        )
    )$

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions