Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Sep 1, 2023

Conversation

palazzem
Copy link
Owner

@palazzem palazzem commented Sep 1, 2023

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

  • Related issues and proposed changes are filled
  • Tests are defining the correct and expected behavior
  • Code is well-documented via docstrings

@palazzem palazzem added this to the 0.2.0 milestone Sep 1, 2023
@palazzem palazzem self-assigned this Sep 1, 2023
@palazzem palazzem merged commit e148e55 into main Sep 1, 2023
@palazzem palazzem deleted the palazzem/pre-commit-hooks branch September 1, 2023 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Include pre-commit hooks
1 participant