Skip to content

Commit 57282b6

Browse files
committed
Change the default header date regex
Allow a single "Copyright 20019" form, as well as the standard "Copyright 2018-2019" range form. Closes gh-72
1 parent 3c61e3c commit 57282b6

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

spring-javaformat/spring-javaformat-checkstyle/src/main/java/io/spring/javaformat/checkstyle/check/SpringHeaderCheck.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public class SpringHeaderCheck extends AbstractFileSetCheck {
5757
/**
5858
* The default header copyright pattern.
5959
*/
60-
public static final String DEFAULT_HEADER_COPYRIGHT_PATTERN = "20\\d\\d-20\\d\\d";
60+
public static final String DEFAULT_HEADER_COPYRIGHT_PATTERN = "20\\d\\d(-20\\d\\d)?";
6161

6262
private String headerType = DEFAULT_HEADER_TYPE;
6363

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
+0 errors
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright 2019-2019 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
/**
18+
* The header doesn't use a date range.
19+
*
20+
* @author Phillip Webb
21+
*/
22+
public class HeaderWithSingleDate {
23+
24+
}

0 commit comments

Comments
 (0)