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

Nicolas Dufresne nicolas at ndufresne.ca
Sat Jan 18 04:54:42 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 staged changes (--staged) and the
combined changes of the index and the last commit (--amend).

Changes in v3:
  - Patch 1 is unchanged
  - Remove yet another mode change (patch 2)
  - The return statement has been improved (patch 2)
  - Static member 'commit' has been removed from Commit class (patch 3)
  - A comment clarifies the return value of Commit.get_info() (patch 3)
  - extract_revlist() has been renamed extract_commits() (patch 3)
  - Index class is now named StagedChanges (patch 4)
  - If statement to set the default revision_range has been improve (patch 4)
  - Typo Amandment.det_info() is fixed to get_info() (patch 5)
  - Description of --amend has been fixed (patch 5)
  - Fixed commit->args variable name (patch 6)

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 staged changes
  checkstyle: Add support for checking style on amendments
  checkstyle: Add a pre-commit hook script

 utils/checkstyle.py    | 120 +++++++++++++++++++++++++++++++++--------
 utils/hooks/pre-commit |  17 ++++++
 2 files changed, 115 insertions(+), 22 deletions(-)
 create mode 100755 utils/hooks/pre-commit

-- 
2.24.1



More information about the libcamera-devel mailing list