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

Nicolas Dufresne nicolas at ndufresne.ca
Fri Jan 17 20:17:27 CET 2020


From: Nicolas Dufresne <nicolas.dufresne at 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

-- 
2.24.1



More information about the libcamera-devel mailing list