-
Notifications
You must be signed in to change notification settings - Fork 599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lint add warnings instead of check failure #2250
Lint add warnings instead of check failure #2250
Conversation
It looks like that: Please remove draft/test: introduce some codding style errors to test new approach when merging this PR, this commit is needed just to illustrate the concept. |
584515d
to
557c116
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## criu-dev #2250 +/- ##
============================================
+ Coverage 70.62% 70.68% +0.06%
============================================
Files 133 133
Lines 33322 33328 +6
============================================
+ Hits 23532 23557 +25
+ Misses 9790 9771 -19
☔ View full report in Codecov by Sentry. |
bd2e675
to
09980dc
Compare
I've added changes to CONTRIBUTING.md with bad clang-formating examples to PR and a link from warnings to CONTRIBUTING.md, so that it would be easier to understand how this warning should be handled. |
f027924
to
f005eb2
Compare
df89fdb
to
69b68e9
Compare
Ctags is mentioned in the beginning of the "Edit the source code" which is really confusing: Do you need ctags to edit CRIU code? - No. It is just one helpful tool to browse the code, and we do not want to enforce it. So, what is it doing in contribution guide? People who really need it should be able to find it in Makefile or just write oneliner of their own to collect tags... Signed-off-by: Pavel Tikhomirov <[email protected]>
This is highlight that code readability is the real goal of all the coding-style rules. We should not do coding-style just for coding-style, e.g. when clang-format suggests crazy formating we should not follow it if we feel it is bad. Signed-off-by: Pavel Tikhomirov <[email protected]>
There are multiple cases where good human readable code block is converted to an unreadable mess by clang-format, so we don't want to rely on clang-format completely. Also there is no way, as far as I can see, to make clang-format only fix what we want it to fix without breaking something. So let's just display hints inline where clang-format is unhappy. When reviewer sees such a warning it's a good sign that something is broken in coding-style around this warning. We add special script which parses diff generated by indent and generates warning for each hunk. Signed-off-by: Pavel Tikhomirov <[email protected]>
69b68e9
to
1a5d201
Compare
1a5d201
to
99d878b
Compare
I've removed test commit to trigger warnings (it works), so it's now ready to merge. |
There are multiple cases where good human readable code block is
converted to an unreadable mess by clang-format, so we don't want to
rely on clang-format completely. Also there is no way, as far as I can
see, to make clang-format only fix what we want it to fix without
breaking something.
So let's just display hints inline where clang-format is unhappy. When
reviewer sees such a warning it's a good sign that something is broken
in codding style around this warning.