AndyWynham / sa-tan

The Maven plugin for checking class mutability within your project

Home Page:https://www.l3r8y.ru/sa-tan/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EO principles respected here DevOps By Rultor.com We recommend IntelliJ IDEA

A plugin for Maven that will let you know you have a problem if it sees setters in your project. When I talk about setters I don't mean method name signatures, I mean methods with a changeable object state

Examples

This class is valid

class MyValidClass {
    private final String name;
    
    public MyValidClass(final String n) {
        this.name = n;
    }
}

This class is invalid

class MyInvalidClass {
    private String name;

    public MyValidClass(final String n) {
        this.name = n;
    }

    public void setName(final String name) {
        this.name = name;
    }
}

How to use

The plugin could be run using several approaches but for both of them you need at least Maven 3.1.+ and Java 8+.

Add as maven plugin into your pom.xml

<build>
  <plugins>
    <plugin>
      <groupId>ru.l3r8y</groupId>
      <artifactId>sa-tan</artifactId>
      <version>0.1.3</version>
      <executions>
        <execution>
          <goals>
            <goal>search</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

Run plugin directly

mvn ru.l3r8y:sa-tan:search

About

The Maven plugin for checking class mutability within your project

https://www.l3r8y.ru/sa-tan/

License:MIT License


Languages

Language:Java 99.1%Language:Groovy 0.9%