2 Commits

Author SHA1 Message Date
Stephen Finucane
5f8dd65f6c Integrate 'pre-commit'
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>
2019-11-28 12:46:55 +00:00
Daniel P. Berrange
a7471dd773 tox: make it possible to run pep8 on current patch only
The 'tox -epep8' command takes a long time as it checks
every single file in the Nova git repository (~1,400 at
time of writing).

This makes tox use a simple wrapper around flake8 which
can be told to restrict the check to only files changed
in the current command. This can be invoked in a simple
manner with 'tox -epep8 -- -HEAD'. Since most commits
only touch a handful of files, this will usually be
far faster than checking all 1,400 source files.

To check an entire branch for bisectability it can be
automated via

  git rebase -i master -x 'tox -epep8 -- -HEAD'

Change-Id: I157d1ccb883ca02402eee51fd7d6a50f86079389
2015-07-24 16:15:38 +01:00