smithros / arch4u-pmd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Maven Javadocs License: MIT Commit activity Hits-of-Code

CI 0pdd Dependency Status Known Vulnerabilities

DevOps By Rultor.com EO badge We recommend IntelliJ IDEA

Qulice Maintainability Rating codebeat badge Codacy Badge Codecov

Overview

arch4u-pmd is a ...

How to use?

Maven

  1. Enable arch4u-pmd rules in pom.xml
    ...
    <build>
      <plugins>
         ...
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-pmd-plugin</artifactId>
            <version>3.15.0</version>
            <executions>
               <execution>
                  <phase>test</phase>
                  <goals>
                     <goal>check</goal>
                  </goals>
               </execution>
            </executions>
            <configuration>
               <printFailingErrors>true</printFailingErrors>
               <rulesets>
                  ...
                  <ruleset>io/github/dgroup/arch4u/pmd/arch4u-ruleset.xml</ruleset>
                  ... 
               </rulesets>
               <excludeRoots>
                  <excludeRoot>target/generated-sources/</excludeRoot>
               </excludeRoots>
            </configuration>
            <dependencies>
              <!-- Latest arch4u-rules -->
              <dependency>
                <groupId>io.github.dgroup</groupId>
                <artifactId>arch4u-pmd</artifactId>
                <version>${version}</version>
              </dependency>
            </dependencies>
         </plugin>
         ...
      </plugins>
    </build>
    ...

Gradle

  1. Activate pmd plugin in build.gradle
    apply plugin: 'pmd'
    
    dependencies {
        ...
        pmd "io.github.dgroup:arch4u-pmd:${version}"    // use latest arch4u-pmd rules version
        pmd "commons-io:commons-io:2.11.0"              // required dependency by pmd engine
        ...
    }
    
    pmd {
        consoleOutput = true
        ruleSetFiles = files("your-pmd-ruleset.xml")
        ruleSets = []                                   // Keep it as is, workaround for pmd
    }
  2. Configure your-pmd-ruleset.xml
    <?xml version="1.0"?>
    <ruleset name="Your pmd rules"
      xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
     
      ...
      <rule ref="io/github/dgroup/arch4u/pmd/arch4u-ruleset.xml"/>
      ...
    
    </ruleset>

How to contribute?

EO badge

  1. Pull requests are welcome! Don't forget to add your name to contribution section and run this, beforehand:
    mvn -Pqulice clean install
  2. Everyone interacting in this project’s codebases, issue trackers, chat rooms is expected to follow the code of conduct.
  3. Latest maven coordinates here:
    <dependency>
        <groupId>io.github.dgroup</groupId>
        <artifactId>arch4u-pmd</artifactId>
        <version>${version}</version>
    </dependency>
  4. Download pmd rule designer - https://pmd.github.io/latest/pmd_userdocs_extending_designer_reference.html

Contributors

About

License:MIT License


Languages

Language:Java 97.5%Language:Shell 2.5%