Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Allow multiple globs in *_BY_PATH dicts
Before this commit, there was repetition in the PRE_COMMIT_REPOS_BY_PATH dictionary: PRE_COMMIT_REPOS_BY_PATH: Final = ( ..., ('**.yaml', PCR_YAMLLINT), ('**.yml', PCR_YAMLLINT), ... ) That repetition was necessary. Before this change, I had to repeat myself in order to specify that both .yaml files and .yml files should enable PCR_YAMLLINT. I want to be able to specify multiple globs to make it easier for me to create two future commits: a type-stub-related commit and a wcwidth-related commit. The wcwidth-related commit will add code that depends on wcwidth [1]. Unfortunately, wcwidth doesn’t have any type hints yet [2], and there doesn’t seem to be a PEP 561 [3] stub package for wcwidth. When a module isn’t typed and there’s no stub package for that module, mypy’s recommendation is to write your own stub files [4]. Before that future wcwidth-related commit, I’m going to add a type-stub-related commit. That type-stub-related commit will make it so that all of the pre-commit hooks for .py files also run for .pyi files [5]. The main motivation behind this commit is to make it easier for me to write that future type-stub-related commit. [1]: <https://pypi.org/project/wcwidth/> [2]: <jquast/wcwidth#71> [3]: <https://peps.python.org/pep-0561/> [4]: <https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-library-stubs-or-py-typed-marker> [5]: <https://mypy.readthedocs.io/en/stable/stubs.html> TODO: • Finish the commits that come after this one. • Make sure that links are backed up in the Internet Archive
- Loading branch information