summaryrefslogtreecommitdiff
path: root/.pre-commit-config.yaml
Commit message (Collapse)AuthorAgeFilesLines
* Switch to hacking 2.xStephen Finucane2020-01-171-1/+1
| | | | | | | | | This bumps the version of flake8 and pycodestyle to something much newer, which resolves a long-standing warning about nested sets and allows us to use new fangled features like f-strings if we so choose. Change-Id: I0bb9077f1cea2243b7945e87cfa140f9cf89d558 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* pre-commit: Use Python 3 to run checksStephen Finucane2020-01-141-0/+3
| | | | | | | | We need this otherwise flake8 will run in Python 2 mode, which results in syntax errors for Python 3-only syntax like kwarg-only functions. Change-Id: Id55dbce1d9a19ccaa4fe605985fb165e9b3ab48c Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Keep pre-commit inline with hacking and fix whitespaceMonty Taylor2019-12-121-3/+14
| | | | | | | | | | | | | | | | | | The flake8 hook for pre-commit installs its own flake8 which is not what hacking is pinned to. This results in a bunch of errors. By doing a local hook we can cause these to be the same. There are flake8 exclusions in tox.ini that need to be used in pre-commit. Also we should exclude svg files from the whitespace modifications, because who cares. Once those are fixed, running pre-commit -a fixes some whitespace issues. While the normal use isn't to run -a - if someone does make a patch that touches any of these they'll get erroneous unrelated errors compared to their lower work - so fix all of the existing issues, which are mostly space-at-end-of-line issues it seems. Change-Id: I78e753492e99c03b30a0a691db3bd75ee3d289c9
* Integrate 'pre-commit'Stephen Finucane2019-11-281-0/+21
This nifty tool provides a extensible way to configure pre-commit hooks to do everything from running linters to spellchecking [1] and has already been adopted by a few OpenStack projects [2]. Let's start using it as a faster, more automatic alternative to the 'fast8' tox target and iterate on it as we find more things to use it for. The 'fast8' target is not deprecated though a note is included for end-users to alert them to this great new tool. Note that the 'check-executables-have-shebangs' actually failed and highlighted that the 'contributor/development-environment.rst' document was marked as executable when it shouldn't have been. This is corrected. [1] https://pre-commit.com/ [2] https://review.opendev.org/#/q/file:.pre-commit-config.yaml Change-Id: I256e75eceeb3495dce04885ca42d16adb4160cf3 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>