pre-commit-hooks icon indicating copy to clipboard operation
pre-commit-hooks copied to clipboard

Some out-of-the-box hooks for pre-commit

Results 33 pre-commit-hooks issues
Sort by recently updated
recently updated
newest added

I get strange issue that file-contents-sorter hook does not work same way everytime. I made little test case which trickers the issue. If i run this 10 times it will...

If you use both the `--index-url` and `--extra-index-url` flags together in a `requirements.txt` file the hook will put `--extra-index-url` above the `--index-url` which causes the url set to `index-url` be...

enhancement
good-first-issue

`pretty-format-json` modifies floating point numbers that have too many digits of precision. ### Background I have to work with JSON files that may be generated by non-python programs. These files,...

The `check-shebang-scripts-are-executable` hook already avoided false negatives in a Git repository by looking up the Git file mode rather than relying on the file mode in the file system. Git...

There are file and directory names which are legal in Git and most operating systems but illegal in Windows. They should be avoided in case a developer happens to use...

Depending on what you're doing, Windows can have a path length limit of 260 characters. It's kind of complicated and there are a number of workarounds but this limit is...

`check-executables-have-shebangs` supports being run on files outside of a Git repository, so it seems natural for `check-shebang-scripts-are-executable` to do the same. I would guess it's also slightly faster to check...

Refs https://github.com/pre-commit/pre-commit-hooks/issues/683

I noticed that [the test suite](https://github.com/pre-commit/pre-commit-hooks/blob/master/tests/check_merge_conflict_test.py#L49) checks for `diff3`-style merge conflicts, but the [actual hook](https://github.com/pre-commit/pre-commit-hooks/blob/master/pre_commit_hooks/check_merge_conflict.py#L8-L11) does not. Seems like an oversight?

As explained in https://trojansource.codes/ and https://www.python.org/dev/peps/pep-0672/ it is very likely to receive trojan source attacks, where some UTF-8 strings contain invisible characters that make your program behave in unexpected ways....