apache / apache/maven-checkstyle-plugin

[MCHECKSTYLE-355] Allow checkstyleRules next to configLocation

Open
#267 0 comments 0 reactions 0 assignees View on GitHub
enhancement priority:minor
Dominant language
Java
Stars
97
Forks
67
Avg merge
14h 50m
Merged PRs (30d)
6

Description

**[HerrDerb](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=herrderb)** opened **[MCHECKSTYLE-355](https://issues.apache.org/jira/browse/MCHECKSTYLE-355?redirect=false)** and commented

**Summary**

Allow to define a `configLocation` and `checkstyleRules` resulting in inline checkstyle rules overriding `configLocation` checks. This would allow a dynamic checkstyle rule configuration.

 

**Current behaviour**
Currently when running the plugin with the following configuration

```java

       google_checks.xml
      
              
                     
             
      
 
```

 it fails and returns

```java
Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.0.0:check (default) on project comlab-pom: If you use inline configuration for rules, don't specify a configLocation
```

**Desired behaviour**

The google check `LineLenth` is overriden by the inline check, defining a valid line length of 120 instead of 80.

 

---
No further details from [MCHECKSTYLE-355](https://issues.apache.org/jira/browse/MCHECKSTYLE-355?redirect=false)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the reported Maven configuration with configLocation and checkstyleRules, then trace how the plugin handles these two settings. Identify the existing validation or configuration-merging entry point; done means inline rules override the corresponding configLocation rule without the current failure, with coverage for the LineLength example.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.