Skip to content

Commit

Permalink
Merge branch 'release/2.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins committed Apr 20, 2023
2 parents f2b5196 + 5d1abc4 commit c924133
Show file tree
Hide file tree
Showing 100 changed files with 1,557 additions and 385 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG_LEGACY.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This changelog is no longer maintained. Follow the release notes at the GitHub r
* Display analysis duration

### Version 1.0.0
* [#35](https://github.com/skuzzle/restrict-imports-enforcer-rule/issues/35): Recognize multiple import statements on same line in groovy sources
* [#35](https://github.com/skuzzle/restrict-imports-enforcer-rule/issues/35): Recognize multiple import statements on same line in groovy sources
* _Remove_ `commentLineBufferSize`

### Version 0.18.0
Expand Down
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Contributions are highly appreciated!

If you have any questions, feature requests or suspected bugs please do not hesitate to
If you have any questions, feature requests or suspected bugs please do not hesitate to
open a new issue.

If you want to actively contribute code, please follow this advice:
I don't want you to waste your time on changes that I might decline, so please open a new
issue before implementing any new feature and sending a pull request. I'm happy to
I don't want you to waste your time on changes that I might decline, so please open a new
issue before implementing any new feature and sending a pull request. I'm happy to
discuss your idea and give advice on how to best implement it.

If your idea is accepted, simply send the PR against the *development* branch.
Contributions should adhere to the coding standards used. All changes and additions
should be covered by unit tests. We do use spaces here :)
If your idea is accepted, simply send the PR against the *development* branch.
Contributions should adhere to the coding standards used. All changes and additions
should be covered by unit tests. We do use spaces here :)
54 changes: 27 additions & 27 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
### Forbid all wildcard imports
```xml
<RestrictImports>
<reason>Don't use wildcard imports</reason>
<bannedImport>**.'*'</bannedImport>
</RestrictImports>
```
_Note_: `'*'` is a special literal which is treated specially. It is only allowed as the last part of a package
pattern.

### Forbid all static imports
```xml
<RestrictImports>
<reason>Don't use static imports</reason>
<bannedImport>static **</bannedImport>
</RestrictImports>
```


### Unify logging frameworks
```xml
<RestrictImports>
<reason>Use slf4j Logger</reason>
<bannedImport>**.Logger</bannedImport>
<allowedImport>org.slf4j.Logger</allowedImport>
</RestrictImports>
```
### Forbid all wildcard imports
```xml
<RestrictImports>
<reason>Don't use wildcard imports</reason>
<bannedImport>**.'*'</bannedImport>
</RestrictImports>
```
_Note_: `'*'` is a special literal which is treated specially. It is only allowed as the last part of a package
pattern.

### Forbid all static imports
```xml
<RestrictImports>
<reason>Don't use static imports</reason>
<bannedImport>static **</bannedImport>
</RestrictImports>
```


### Unify logging frameworks
```xml
<RestrictImports>
<reason>Use slf4j Logger</reason>
<bannedImport>**.Logger</bannedImport>
<allowedImport>org.slf4j.Logger</allowedImport>
</RestrictImports>
```
164 changes: 88 additions & 76 deletions README.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Maven Central](https://img.shields.io/static/v1?label=MavenCentral&message=2.1.0&color=blue)](https://search.maven.org/artifact/de.skuzzle.enforcer/restrict-imports-enforcer-rule/2.1.0/jar) [![JavaDoc](https://img.shields.io/static/v1?label=JavaDoc&message=2.1.0&color=orange)](http://www.javadoc.io/doc/de.skuzzle.enforcer/restrict-imports-enforcer-rule/2.1.0)
[![Maven Central](https://img.shields.io/static/v1?label=MavenCentral&message=2.2.0&color=blue)](https://search.maven.org/artifact/de.skuzzle.enforcer/restrict-imports-enforcer-rule/2.2.0/jar) [![JavaDoc](https://img.shields.io/static/v1?label=JavaDoc&message=2.2.0&color=orange)](http://www.javadoc.io/doc/de.skuzzle.enforcer/restrict-imports-enforcer-rule/2.2.0)

### Features
* [#57](https://github.com/skuzzle/restrict-imports-enforcer-rule/issues/57) Detect full qualified class usages (must be enabled via `<parseFullCompilationUnit>true</parseFullCompilationUnit>`
* [#60](https://github.com/skuzzle/restrict-imports-enforcer-rule/issues/60) Fall back to _line-by-line_ parsing if _full-compilation-unit_ parsing failed.



Expand All @@ -11,6 +11,6 @@ Maven Central coordinates for this release:
<dependency>
<groupId>de.skuzzle.enforcer</groupId>
<artifactId>restrict-imports-enforcer-rule</artifactId>
<version>2.1.0</version>
<version>2.2.0</version>
</dependency>
```
```
Empty file modified mvnw
100644 → 100755
Empty file.
52 changes: 50 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</parent>
<groupId>de.skuzzle.enforcer</groupId>
<artifactId>restrict-imports-enforcer-rule</artifactId>
<version>2.1.0</version>
<version>2.2.0</version>
<packaging>jar</packaging>
<name>Restrict Imports Enforcer Rule</name>
<description>Bans imports of specified classes/packages</description>
Expand All @@ -28,7 +28,8 @@
<version.jimfs>1.2</version.jimfs>
<version.java-parser>3.24.10</version.java-parser>
<version.resources-plugin>3.2.0</version.resources-plugin>
<version.invoker-plugin>3.1.0</version.invoker-plugin>
<version.invoker-plugin>3.5.1</version.invoker-plugin>
<version.spotless-plugin>2.34.0</version.spotless-plugin>
<site.name>restrict-imports-enforcer-rule</site.name>
<github.name>restrict-imports-enforcer-rule</github.name>
<!-- dont break on dependency failure -->
Expand Down Expand Up @@ -156,6 +157,52 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>${version.spotless-plugin}</version>
<configuration>
<formats>
<!-- you can define as many formats as you want, each is independent -->
<format>
<!-- define the files to apply to -->
<includes>
<include>*.md</include>
<include>.gitignore</include>
<include>pom.xml</include>
</includes>
<!-- define the steps to apply to those files -->
<trimTrailingWhitespace/>
<endWithNewline/>
<indent>
<spaces>true</spaces>
<spacesPerTab>4</spacesPerTab>
</indent>
</format>
</formats>
<!-- define a language-specific format -->
<java>
<eclipse>
<file>${project.basedir}/spotless/formatter-settings.xml</file>
</eclipse>
<importOrder>
<wildcardsLast>false</wildcardsLast>
<file>${project.basedir}/spotless/eclipse.importorder</file>
</importOrder>
<removeUnusedImports/>
<formatAnnotations/>
<trimTrailingWhitespace/>
<endWithNewline/>
</java>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
Expand Down Expand Up @@ -229,6 +276,7 @@
<pomInclude>**/pom.xml</pomInclude>
<!-- Include sub directories -->
</pomIncludes>
<parallelThreads>2C</parallelThreads>
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
<mavenOpts>${argLine}</mavenOpts>
</configuration>
Expand Down
Loading

0 comments on commit c924133

Please sign in to comment.