cachix / git-hooks.nix

Seamless integration of https://pre-commit.com git hooks with Nix.
Apache License 2.0
500 stars 149 forks source link

Feature request: hook for flynt, configuration for pyupgrade #238

Open arjan-s opened 1 year ago

arjan-s commented 1 year ago

Examples from my current .pre-commit-config.yaml:

repos:
  - repo: https://github.com/asottile/pyupgrade
    rev: v3.3.1
    hooks:
      - id: pyupgrade
        args: [--py310-plus]
        exclude: /migrations/
  - repo: https://github.com/pre-commit/mirrors-mypy
    rev: v0.991
    hooks:
      - id: mypy
        additional_dependencies: ['types-requests', 'types-python-dateutil', 'types-pytz']
        exclude: /migrations/
  - repo: https://github.com/ikamensh/flynt/
    rev: '0.77'
    hooks:
      - id: flynt
        exclude: /migrations/
totoroot commented 1 year ago

mypy and pyupgrade are already available, so really this issue is just a request for flynt. Maybe we should update the issue title.

arjan-s commented 1 year ago

The mypy hook works well, but the pyupgrade hook doesn't allow to define the target Python version, so it's not very usable.

totoroot commented 1 year ago

Alright, thanks for clarifying. I'll take a look later this week.