* Fix flake8 pre-commit hook to run on pyi files too
* Fix pycln pre-commit hook
* Run on pyi files too
* Remove `stubs stdlib tests scripts` in args to avoid running pycln on files twice
This doesn't autofix, see #9742
> GitHub prevented pre-commit.ci from autofixing this pr due to autofixes to a workflow file
Life is too short to spend it being yelled at by robots because line
length in some YAML is too long.
- Add a few more hooks. These are all very fast, and I've found them useful in other projects:
- Autofixes:
- `trailing-whitespace`: fixes trailing whitespace
- `requirements-txt-fixer`: alphabetises items in `requirements.txt` files
- `end-of-file-fixer`: makes sure every file ends with a single newline character
- `mixed-line-ending`: Makes sure Windows users don't accidentally introduce CRLF line endings into a file that uses LF line endings
- None-autofixes:
- `check-yaml`: loads YAML files to validate syntax
- `check-toml`: loads TOML files to validate syntax
- `check-merge-conflict`: detects merge-conflict strings in files and blocks them from accidentally being committed
- `check-case-conflict`: checks for files with names that would conflict on a case-insensitive filesystem like MacOS HFS+ or Windows FAT; blocks them from being committed.
- Change the bot schedule to quarterly, to reduce noisy PRs
- Change the `black` language target-version to Python 3.10, synching the setting here with the changes that were made to our `pyproject.toml` file in #7538
This makes it easier to lint your own work with `pre-commit`, but doesn't change the CI config by adding this to the pre-commit.ci skip list.
There's no way to automatically reflect the additional dependencies from the requirements file, so the flake8 plugin list needs to be a verbatim copy.
resolves#7991