[libcamera-devel,v2,0/6] Add the ability to do pre-commit style check
mbox series

Message ID 20200117191733.198897-1-nicolas@ndufresne.ca
Headers show
Series
  • Add the ability to do pre-commit style check
Related show

Message

Nicolas Dufresne Jan. 17, 2020, 7:17 p.m. UTC
From: Nicolas Dufresne <nicolas.dufresne@collabora.com>

This series adds the ability to do pre-commit style check. Internally, this adds
the ability to use checkstyle.py to check index changes (--staged) and the combined
changes the index changes and the last commit (--amend).

Hopefully I have covered all the review comments, note that I ended up
refactoring a lot with hope this is cleaner and less ambiguous.

Changes in v2:
  - Fixed the checkstyle.py mode
  - Split into smaller patches
  - Only pass 0 or 1 to exit()
  - Replace boolean "staged" parameter with a Commit object
  - Subclass Commit to introduce special cases for Index and Amendment
  - Introduce a argument "--amend" to disambeguate the CLI 

Nicolas Dufresne (6):
  checkstyle: Move from pep8 to pycodestyle
  checkstyle: Exit with 1 status if issues are found
  checkstyle: Introduce a Commit class
  checkstyle: Add support for checking style on indexed changes
  checkstyle: Add support for checking style on amendments
  checkstyle: Add a pre-commit hook script

 utils/checkstyle.py    | 114 +++++++++++++++++++++++++++++++++--------
 utils/hooks/pre-commit |  17 ++++++
 2 files changed, 110 insertions(+), 21 deletions(-)
 create mode 100755 utils/hooks/pre-commit