File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed
test/java/com/diffplug/spotless/generic Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" ?>
2
+ <!DOCTYPE module PUBLIC "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd">
3
+
4
+ <module name =" Checker" >
5
+ <module name =" ThisIsNotARealCheckstyleConfigFolks" >
6
+ <property name =" goodAdvice" value =" dontTryItAnakin" />
7
+ <property name =" adviceGiver" value =" generalKenobi" />
8
+ </module >
9
+ </module >
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" ?>
2
+ <!DOCTYPE module PUBLIC "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd">
3
+ <!--
4
+ -- This is a fake license header.
5
+ -- All rights reserved.
6
+ -->
7
+
8
+ <module name =" Checker" >
9
+ <module name =" ThisIsNotARealCheckstyleConfigFolks" >
10
+ <property name =" goodAdvice" value =" dontTryItAnakin" />
11
+ <property name =" adviceGiver" value =" generalKenobi" />
12
+ </module >
13
+ </module >
Original file line number Diff line number Diff line change @@ -122,6 +122,13 @@ void should_remove_header_when_empty() throws Throwable {
122
122
.test (getTestResource ("license/HasLicense.test" ), getTestResource ("license/MissingLicense.test" ));
123
123
}
124
124
125
+ @ Test
126
+ void should_skip_lines_matching_predefined_pattern () throws Throwable {
127
+ StepHarness .forStep (LicenseHeaderStep .headerDelimiter ("<!--\n -- This is a fake license header.\n -- All rights reserved.\n -->" , "^(?!<!--|\\ s+--).*$" )
128
+ .withSkipLinesMatching ("(?i)^(<\\ ?xml[^>]+>|<!doctype[^>]+>)$" ).build ())
129
+ .testResource ("license/SkipLines.test" , "license/SkipLinesHasLicense.test" );
130
+ }
131
+
125
132
private String licenceWithAddress () {
126
133
return "Copyright © $YEAR FooBar Inc. All Rights Reserved.\n " +
127
134
" *\n " +
You can’t perform that action at this time.
0 commit comments