Added -e flag to exclude repair of a file containing DO NOT ALTER OR REMOVE COPYRIGHT NOTICES - #10
cesarhernandezgt wants to merge 4 commits into
Conversation
…REMOVE COPYRIGHT NOTICES Signed-off-by: CesarHernandezGt <chernandez@tomitribe.com>
|
I noticed that this project uses tab instead of spaces, not sure if that is an issue for this pr. |
kwsutter
left a comment
There was a problem hiding this comment.
I think the main issue is the indentation. I didn't mark every occurrence via this review, but I think you'll get the picture. Thanks.
| private static Pattern bsdpat = Pattern.compile( | ||
| "(THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)"+ | ||
| "|(SPDX-License-Identifier: BSD-3-Clause)", Pattern.MULTILINE); | ||
| // patter to detect DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
| if (c.warn && !c.quiet) | ||
| warnCopyright(file, r); | ||
| if (c.warn && !c.quiet){ | ||
| warnCopyright(file, r); |
There was a problem hiding this comment.
Formatting doesn't look right. Are you using tabs or spaces (preferred)?
| if (c.warn && !c.quiet) | ||
| warnCopyright(file, r); | ||
| if (c.warn && !c.quiet){ | ||
| warnCopyright(file, r); |
There was a problem hiding this comment.
Formatting doesn't look right. Are you using tabs or spaces (preferred)? Way too much indentation.
| } | ||
|
|
||
| /** | ||
| /** |
|
|
||
| /** | ||
| /** | ||
| * Verifies if he file contains the message: |
| * -x check XML syntax files | ||
| * -p check properties syntax files | ||
| * -t check other text files | ||
| * -e exclude files that contains DO NOT ALTER OR REMOVE COPYRIGHT NOTICES |
| "(THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS)"+ | ||
| "|(SPDX-License-Identifier: BSD-3-Clause)", Pattern.MULTILINE); | ||
| // patter to detect DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. | ||
| protected static Pattern dontpat = Pattern.compile(DONT_ALTER_HEADER); |
There was a problem hiding this comment.
Personally, I'd make this variable name a little easier to understand and readable. I know you were just following the pattern for the "bsdpat" variable, but I would think something like "doNotAlterPattern" would be clearer. I'll leave it to you though.
I agree, Scott. Spaces should be used instead of tabs. |
|
IIRC all the sources in this project are formatted with tabs. CC @bshannon |
According to the Jakarta Code Convention it should indeed be spaces. Although we had it in words once (it was lost during a wiki transfer, and should be redone), it's in code here: |
|
I'm not disagreeing with the rules :) This project was donated as-is and not converted to spaces. @bshannon is the original author, I just wanted to make sure he knows about this discussion. |
|
Thank you for the review so far. I'll polish the variable name and fix the typos during the week. About the space vs tab, I don't have any strong opinion. My proposal would be:
|
Signed-off-by: CesarHernandezGt <chernandez@tomitribe.com>
…or editing Signed-off-by: CesarHernandezGt <chernandez@tomitribe.com>
Signed-off-by: CesarHernandezGt <chernandez@tomitribe.com>
|
Thanks for the review so far. As you can check that didn't resolve the majority of the indentation issues. |
Fixes #9
How to test this PR:
The repair is not applied if the file contains the Do not alter or remove notices.