[Buildroot] [1/5] check-package: fix check of file in current dir with -b

Ricardo Martincoski ricardo.martincoski at gmail.com
Sat Nov 3 22:48:00 UTC 2018


On Sat, Nov 03, 2018 at 05:09 PM, Vitaliy Lotorev wrote:

> My comments regarding patch [1].
>> always use the absolute path of the file being checked when
>> -b was passed. A small drawback is that the warning messages will occupy
>> more columns in this case,
> For user it would be quite unexpected to see that paths used in
> check-package arguments mismatch paths printed in stdout.
> I can't think of applications that absolutize paths.
> Е.g when GCC, flake8, cppcheck find errors/warnings they print file names
> as they were passed to binary call.

Thank you for your feedback.
You have a good point.
I will rework the patch to keep the relative paths in the output of the script.

> My current usage of check-package - verify patch on Gerrit and vote back.
> But in future I'd like to have an ability to report back each line warning
> as a bot comment right on file diff screen.

... adding a comment to the exact line that adds a code-style violation.

> To do this I neet to construct JSON containing list of {'filename', 'line',
> 'message'} dicts where 'filename' - file path relative to repo root.
> Simplified calls when commit under review is checked out:
> files=$(git diff --diff-filter ACMRT --name-only HEAD~)
> <path-to-buildroot>/utils/check-package --br2-external $files > errors.log
> <convert-to-json> errors.txt > errors.json
> <post-comments> errors.json
> In case check-package will print absolute paths into errors.log extra logic
> will be required to make paths relative back again.
> [1] http://patchwork.ozlabs.org/patch/992601/


More information about the buildroot mailing list