Enforce checkstyle header rule

Enforce the checkstyle header rule and fix a few classes that had
malformed headers.

Issue gh-8945
This commit is contained in:
Phillip Webb 2020-07-29 14:14:23 -07:00 committed by Rob Winch
parent ff94944313
commit 8559447357
6 changed files with 23 additions and 27 deletions

View File

@ -13,9 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
*
*/
package org.springframework.security.access.expression.method;

View File

@ -16,25 +16,6 @@
package org.springframework.security.core;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;

View File

@ -13,9 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
*
*/
package org.springframework.security.authentication.dao;

View File

@ -3,7 +3,6 @@
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
<suppressions>
<suppress files=".*" checks="SpringHeader" />
<suppress files=".*" checks="SpringHideUtilityClassConstructor" />
<suppress files=".*" checks="SpringJavadoc" />
<suppress files=".*" checks="SpringLambda" />

View File

@ -7,5 +7,11 @@
<property name="file"
value="${config_loc}/checkstyle-suppressions.xml" />
</module>
<module name="io.spring.javaformat.checkstyle.SpringChecks" />
<module name="com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck">
<property name="headerFile" value="${config_loc}/header.txt" />
<property name="fileExtensions" value="java" />
</module>
<module name="io.spring.javaformat.checkstyle.SpringChecks">
<property name="excludes" value="io.spring.javaformat.checkstyle.check.SpringHeaderCheck" />
</module>
</module>

16
etc/checkstyle/header.txt Normal file
View File

@ -0,0 +1,16 @@
^\Q/*\E$
^\Q * Copyright \E20\d\d(-20\d\d)?(, \d\d\d\d)*\ (Acegi Technology Pty Limited|the original author or authors.)$
^\Q *\E$
^\Q * Licensed under the Apache License, Version 2.0 (the "License");\E$
^\Q * you may not use this file except in compliance with the License.\E$
^\Q * You may obtain a copy of the License at\E$
^\Q *\E$
^\Q * https://www.apache.org/licenses/LICENSE-2.0\E$
^\Q *\E$
^\Q * Unless required by applicable law or agreed to in writing, software\E$
^\Q * distributed under the License is distributed on an "AS IS" BASIS,\E$
^\Q * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\E$
^\Q * See the License for the specific language governing permissions and\E$
^\Q * limitations under the License.\E$
^\Q */\E$
^$