libcamera/utils
Kieran Bingham 300654217e utils: checkstyle.py: Support single line hunks
The checkstyle script expects hunks to be declared with a start line and
line count, however the unified diff format [0] declares that a single
line hunk will only have the start line:

> If a hunk contains just one line, only its start line number appears.
> Otherwise its line numbers look like ‘start,count’. An empty hunk is
> considered to start at the line that follows the hunk.

[0] https://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html#Detailed-Unified

Attempting to parse a single line hunk results in the following error:

  File "./utils/checkstyle.py", line 110, in __init__
    raise RuntimeError("Malformed diff hunk header '%s'" % line)
  RuntimeError: Malformed diff hunk header '@@ -1 +1,2 @@

The DiffHunk class only makes use of the start line, and does not
utilise the line count, thus update the regex to make the unused
groups optional.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-01-07 16:37:28 +00:00
..
hooks utils: hooks: Provide post-commit hook example to checkstyle.py 2019-01-30 10:57:37 +00:00
ipu3 utils: ipu3: process: Configure formats on ImgU subdev pads 2018-12-11 15:58:19 +02:00
rkisp1 utils: rkisp1: Add test capture script 2019-03-29 16:39:10 +02:00
checkstyle.py utils: checkstyle.py: Support single line hunks 2020-01-07 16:37:28 +00:00
gen-version.sh libcamera: skip auto version generation when building for Chromium OS 2019-07-11 12:22:40 +09:00
meson.build utils: ipu3: Add IPU3 raw capture unpack utility 2018-11-20 03:06:41 +02:00