your configuration is incorrect, you haven't limited the files that are passed to your hook with either files
or types
so it is defaulting to all files in your repository. presumably you have some binary file which is being passed to flakehell
I also notice that your configuration passes both a path and has pass_filenames: true
(pass_filenames: true
is the default so you shouldn't use that)
you either want to list paths in args (not recommended since you always lint more than what you're changing) or you want to filter the filenames properly
additionally, verbose: true
is not intended for use outside of debugging as it adds warning noise to the output
additionally, you're not managing the installation of flakehell through pre-commit which will add additional burden to your contributors to try and set up whatever development environment locally, most of the point of pre-commit is that it manages installing your tools so your contributors don't have to jump through hoops to have the correct formatting / linting setup (eliminating a whole class of "it works on my machine" problems)
additionally, it looks like flakehell has direct support for pre-commit, so you don't need to use the repo: local
escape hatch as you're doing
putting all of that together, you probably want something like this:
repos:
- repo: https://github.com/life4/flakehell
rev: v.0.7.1
hooks:
- id: flakehell
if you want to go with your local configuration you probably want something like:
repos:
- repo: local
hooks:
- id: flakehell
name: flakehell
entry: flakehell lint
types: [python]
files: ^project/
language: python
additional_dependencies: [flakehell==0.7.1]
stages: [push, commit]
disclaimer: I'm the creator of pre-commit
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…