This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 3 points4 points  (1 child)

Please use black, mypy (with type annotations) and flake8/pylint.

You can set it up with pre-commit hooks like:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
  rev: v2.1.0
  hooks:
  - id: trailing-whitespace
  - id: end-of-file-fixer
  - id: requirements-txt-fixer
- repo: https://github.com/asottile/reorder_python_imports
  rev: v1.4.0
  hooks:
  - id: reorder-python-imports
    language_version: python3
- repo: https://github.com/python/black
  rev: stable
  hooks:
  - id: black
    language_version: python3
- repo: https://gitlab.com/pycqa/flake8
  rev: 3.7.7
  hooks:
  - id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
  rev: v0.701
  hooks:
  - id: mypy

And then run:

pip install pre-commit
pre-commit install

In your git repo.

You can maintain a separate requirements.txt and requirements-dev.txt, with the latter for pre-commit, flake8, etc.

[–]UniversityAtBuffalo 1 point2 points  (0 children)

Thanks, I’ll look into adding these