palazzem / econnect-python

API adapter used to control programmatically an Elmo alarm system
BSD 3-Clause "New" or "Revised" License
8 stars 5 forks source link

tools: use pre-commit hooks to run linters and static analyzers #93

Closed palazzem closed 10 months ago

palazzem commented 10 months ago

Related Issues

Proposed Changes:

Leverages pre-commit hooks to run linters and static analyzer tools at every commit. Used pre-commit hooks are:

- repo: https://github.com/pre-commit/pre-commit-hooks
  rev: v4.4.0
  hooks:
    - id: check-ast
    - id: check-json
    - id: check-merge-conflict
    - id: check-toml
    - id: check-yaml
    - id: end-of-file-fixer
    - id: mixed-line-ending
    - id: trailing-whitespace

On top of that, we leverage other plugins:

- repo: https://github.com/PyCQA/isort
- repo: https://github.com/asottile/pyupgrade
- repo: https://github.com/psf/black
- repo: https://github.com/PyCQA/flake8
- repo: https://github.com/PyCQA/bandit
- repo: https://github.com/astral-sh/ruff-pre-commit
- repo: https://github.com/pre-commit/mirrors-mypy

Testing:

To run tests, simply launch tox. From now on, linters are executed at every commit.

Extra Notes (optional):

None.

Checklist