-
Notifications
You must be signed in to change notification settings - Fork 8
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
Added -e flag to exclude repair of a file containing DO NOT ALTER OR REMOVE COPYRIGHT NOTICES #10
base: master
Are you sure you want to change the base?
Conversation
…REMOVE COPYRIGHT NOTICES Signed-off-by: CesarHernandezGt <[email protected]>
I noticed that this project uses tab instead of spaces, not sure if that is an issue for this pr. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -93,6 +95,8 @@ | |||
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit typo: "pattern"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 620fdb2
if (c.warn && !c.quiet) | ||
warnCopyright(file, r); | ||
if (c.warn && !c.quiet){ | ||
warnCopyright(file, r); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting doesn't look right. Are you using tabs or spaces (preferred)? Way too much indentation.
@@ -332,7 +345,24 @@ else if (lc == null) | |||
System.out.println("No errors: " + file); | |||
} | |||
|
|||
/** | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation problem again?
@@ -332,7 +345,24 @@ else if (lc == null) | |||
System.out.println("No errors: " + file); | |||
} | |||
|
|||
/** | |||
/** | |||
* Verifies if he file contains the message: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit typo: "if the file.."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 620fdb2
@@ -39,6 +39,7 @@ | |||
* -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation again...
@@ -93,6 +95,8 @@ | |||
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. | |||
protected static Pattern dontpat = Pattern.compile(DONT_ALTER_HEADER); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 620fdb2
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 <[email protected]>
…or editing Signed-off-by: CesarHernandezGt <[email protected]>
Signed-off-by: CesarHernandezGt <[email protected]>
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.