Kalle Richter
Kalle Richter

Reputation: 8778

How to avoid violation of checkstyle rule JavadocParagraph in header?

After an upgrade from 8.2 to 8.23 I'm experiencing violations for missing <p> tags before and after the URL in the license header

/**
 * 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
 *
 * http://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.
 */

package bla;

import blu;

public class Bli {

without changing the code.

I'm not sure whether the violation is correct, i.e. whether the rule should be applied to text above package or whether it's a bug.

In case it isn't a bug I'm planning to suggest and option to allow turning of this check more easily.

I'm using checkstyle through Maven 3.6.0 with the maven-checkstyle-plugin 3.1.0.

The easiest approach would be to change /** */ to /* */ in the license header, but I don't want to have to propose and do the change for a tool version upgrade.

Upvotes: 1

Views: 227

Answers (1)

Roman Ivanov
Roman Ivanov

Reputation: 2537

If comment has javadoc identtifier, checkstyle apply all rules to it. Violation is valid.

If you do not want to change header format, please use suppression https://checkstyle.org/config_filters.html

Upvotes: 1

Related Questions