Skip to content

Commit

Permalink
Merge branch 'release/2.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins committed Jul 18, 2023
2 parents 9676420 + 28dc202 commit 61a5884
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 24 deletions.
54 changes: 45 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!-- This file is auto generated during release from readme/README.md -->

[![Maven Central](https://img.shields.io/static/v1?label=MavenCentral&message=2.4.0-rc1&color=blue)](https://search.maven.org/artifact/de.skuzzle.enforcer/restrict-imports-enforcer-rule/2.4.0-rc1/jar)
[![JavaDoc](https://img.shields.io/static/v1?label=JavaDoc&message=2.4.0-rc1&color=orange)](http://www.javadoc.io/doc/de.skuzzle.enforcer/restrict-imports-enforcer-rule/2.4.0-rc1)
[![Maven Central](https://img.shields.io/static/v1?label=MavenCentral&message=2.4.0&color=blue)](https://search.maven.org/artifact/de.skuzzle.enforcer/restrict-imports-enforcer-rule/2.4.0/jar)
[![Coverage Status](https://coveralls.io/repos/github/skuzzle/restrict-imports-enforcer-rule/badge.svg?branch=master)](https://coveralls.io/github/skuzzle/restrict-imports-enforcer-rule?branch=master)
[![Twitter Follow](https://img.shields.io/twitter/follow/skuzzleOSS.svg?style=social)](https://twitter.com/skuzzleOSS)

Expand All @@ -17,7 +16,7 @@ Tested against _maven-enforcer-plugin_ versions `1.4.1` and `3.3.0`.

## Simple usage
This is a minimal usage example. Please scroll down for detailed configuration
information.
information or have a look at the [Full configuration example](#full-configuration-example).

```xml
<plugin>
Expand All @@ -28,7 +27,7 @@ information.
<dependency>
<groupId>de.skuzzle.enforcer</groupId>
<artifactId>restrict-imports-enforcer-rule-parent</artifactId>
<version>2.4.0-rc1</version>
<version>2.4.0</version>
</dependency>
</dependencies>
<executions>
Expand Down Expand Up @@ -71,6 +70,7 @@ information.
* [Limitation](#limitation)
* [Syntactical](#syntactical-limitation)
* [Conceptual](#conceptual-limitation)
* [Full configuration example](#full-configuration-example)
* [Configuration options](#configuration-options)
* [Versioning, Deprecations and Compatibility](#versioning-deprecations-and-compatibility)

Expand Down Expand Up @@ -176,6 +176,8 @@ you can allow them to be used only in some explicitly configured locations.
</configuration>
```

You can add multiple _not-fixable_ definitions if you nest them in `<notFixables></notFixables>`.

> **Note**
> Not fixable definitions can not be nested in `<groups>` (see _Rule groups_ below). Not-fixables apply globally per
> `RestrictImports` rule instance.
Expand Down Expand Up @@ -258,8 +260,6 @@ analysis of test code using the `includeTestCode` option.
</configuration>
```

You can add multiple _not-fixable_ definitions if you nest them in `<notFixables></notFixables>`.

## Skipping
Using the configuration option `skip` you are able to temporarily disable a rule
instance.
Expand Down Expand Up @@ -311,7 +311,7 @@ is not limited to `${project.basedir}/src/main/java`, `${project.basedir}/src/te
```

## Parallel Analysis
We support basic parallelization of the analysis. This is disabled by default but can be enabled either in the pom file
We support basic parallelization of the analysis. This is enabled by default but can be disabled either in the pom file
using the `<parallel>` option or by passing `-Drestrictimports.parallel` to the maven build.
```xml
<configuration>
Expand Down Expand Up @@ -345,7 +345,7 @@ java source file, creating an actual AST. This allows to also detect full qualif
considerably slower.

> **Warning**
> In case a source file cannot be properly parsed, we try to fall back to our _native_ line-by-line_ parsing
> In case a source file cannot be properly parsed, we try to fall back to our _native_ line-by-line parsing
> approach described [here](#syntactical-limitation). A respective warning will be issued in the
> report that is generated at the end.
>
Expand Down Expand Up @@ -408,6 +408,41 @@ statement. Thus if your `exclusion` pattern points to a concrete class like
with the exact name `ClassName.java`. The same applies in case you use a base package
pattern with no wild cards.

## Full configuration example
```xml
<RestrictImports>
<failBuild>true</failBuild> <!-- Can be overridden with -Drestrictimports.failBuild=... -->
<skip>false</skip> <!-- Can be overridden with -Drestrictimports.skip=... -->
<parseFullCompilationUnit>false</parseFullCompilationUnit>
<parallel>true</parallel> <!-- Can be overridden with -Drestrictimports.parallel=... -->
<excludedSourceRoots> <!-- Optional. Nesting not needed when specifying a excluded root -->
<excludedSourceRoot>${project.build.directory}/generated-sources/main/java</excludedSourceRoot>
</excludedSourceRoots>
<groups>
<group> <!-- Optional. groups and group can be left out in simple configurations -->
<reason>...</reason>
<basePackages> <!-- Optional. Nesting not needed when specifying a single package -->
<basePackage>**</basePackage>
</basePackages>
<bannedImports> <!-- Optional. Nesting not needed when specifying a single package -->
<bannedImport>..</bannedImport>
</bannedImports>
<allowedImports> <!-- Optional. Nesting not needed when specifying a single package -->
<allowedImport>...</allowedImport>
</allowedImports>
</group>
</groups>
<notFixables> <!-- Optional. Nesting not needed when specifying a single not-fixable -->
<notFixable>
<in>**</in>
<allowedImports> <!-- Optional. Nesting not needed when specifying a single package -->
<allowedImport>..</allowedImport>
</allowedImports>
</notFixable>
</notFixables>
</RestrictImports>
```

## Configuration options

Overview of all configuration parameters:
Expand All @@ -418,12 +453,13 @@ Overview of all configuration parameters:
| `bannedImport(s)` | (List of) package pattern | yes | | |
| `allowedImport(s)` | (List of) package pattern | no | empty list | |
| `exclusion(s)` | (List of) package pattern | no | empty list | |
| `includeTestCode` | Boolean | no | `false` | `0.7.0` |
| `includeTestCode` | Boolean | no | `true` | `0.7.0` |
| `reason` | String | no | empty String | `0.8.0` |
| `failBuild` | Boolean | no | `true` | `0.17.0` |
| `skip` | Boolean | no | `false` | `0.17.0` |
| `includeCompileCode` | Boolean | no | `true` | `1.2.0` |
| `excludedSourceRoot(s)` | (List of) java.io.File | no | empty list | `1.3.0` |
| `parallel` | Boolean | no | `true` | `2.0.0` |
| `parseFullCompilationUnit` | Boolean | no | `false` | `2.1.0` |
| `notFixable(s)` | (List of) NotFixableDefinition | no | empty list | `2.4.0` |

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

### Bug fixes
* [#55](https://github.com/skuzzle/restrict-imports-enforcer-rule/issues/55) Make parallel analysis the default
Expand All @@ -10,6 +10,6 @@ Maven Central coordinates for this release:
<dependency>
<groupId>de.skuzzle.enforcer</groupId>
<artifactId>restrict-imports-enforcer-rule</artifactId>
<version>2.4.0-rc1</version>
<version>2.4.0</version>
</dependency>
```
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.skuzzle.enforcer</groupId>
<artifactId>restrict-imports-enforcer-rule-parent</artifactId>
<version>2.4.0-rc1</version>
<version>2.4.0</version>
</parent>
<artifactId>restrict-imports-enforcer-rule-core</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion enforcer-rule-maven-it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.skuzzle.enforcer</groupId>
<artifactId>restrict-imports-enforcer-rule-parent</artifactId>
<version>2.4.0-rc1</version>
<version>2.4.0</version>
</parent>
<artifactId>restrict-imports-enforcer-rule-maven-it</artifactId>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion enforcer-rule/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>de.skuzzle.enforcer</groupId>
<artifactId>restrict-imports-enforcer-rule-parent</artifactId>
<version>2.4.0-rc1</version>
<version>2.4.0</version>
</parent>
<artifactId>restrict-imports-enforcer-rule</artifactId>
<packaging>jar</packaging>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>de.skuzzle.enforcer</groupId>
<artifactId>restrict-imports-enforcer-rule-parent</artifactId>
<version>2.4.0-rc1</version>
<version>2.4.0</version>
<packaging>pom</packaging>
<name>Restrict Imports Enforcer Rule Aggregator</name>
<description>Bans imports of specified classes/packages</description>
Expand Down Expand Up @@ -260,7 +260,7 @@
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>restrict-imports-enforcer-rule</artifactId>
<version>2.3.1</version>
<version>2.4.0-rc1</version>
</dependency>
</dependencies>
<executions>
Expand Down
50 changes: 43 additions & 7 deletions readme/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!-- This file is auto generated during release from readme/README.md -->

[![Maven Central](https://img.shields.io/static/v1?label=MavenCentral&message=${project.version}&color=blue)](https://search.maven.org/artifact/${project.groupId}/restrict-imports-enforcer-rule/${project.version}/jar)
[![JavaDoc](https://img.shields.io/static/v1?label=JavaDoc&message=${project.version}&color=orange)](http://www.javadoc.io/doc/${project.groupId}/restrict-imports-enforcer-rule/${project.version})
[![Coverage Status](https://coveralls.io/repos/github/skuzzle/${github.name}/badge.svg?branch=master)](https://coveralls.io/github/skuzzle/${github.name}?branch=master)
[![Twitter Follow](https://img.shields.io/twitter/follow/skuzzleOSS.svg?style=social)](https://twitter.com/skuzzleOSS)

Expand All @@ -17,7 +16,7 @@ Tested against _maven-enforcer-plugin_ versions `${version.min-supported-enforce

## Simple usage
This is a minimal usage example. Please scroll down for detailed configuration
information.
information or have a look at the [Full configuration example](#full-configuration-example).

```xml
<plugin>
Expand Down Expand Up @@ -71,6 +70,7 @@ information.
* [Limitation](#limitation)
* [Syntactical](#syntactical-limitation)
* [Conceptual](#conceptual-limitation)
* [Full configuration example](#full-configuration-example)
* [Configuration options](#configuration-options)
* [Versioning, Deprecations and Compatibility](#versioning-deprecations-and-compatibility)

Expand Down Expand Up @@ -176,6 +176,8 @@ you can allow them to be used only in some explicitly configured locations.
</configuration>
```

You can add multiple _not-fixable_ definitions if you nest them in `<notFixables></notFixables>`.

> **Note**
> Not fixable definitions can not be nested in `<groups>` (see _Rule groups_ below). Not-fixables apply globally per
> `RestrictImports` rule instance.
Expand Down Expand Up @@ -258,8 +260,6 @@ analysis of test code using the `includeTestCode` option.
</configuration>
```

You can add multiple _not-fixable_ definitions if you nest them in `<notFixables></notFixables>`.

## Skipping
Using the configuration option `skip` you are able to temporarily disable a rule
instance.
Expand Down Expand Up @@ -311,7 +311,7 @@ is not limited to `\${project.basedir}/src/main/java`, `\${project.basedir}/src/
```

## Parallel Analysis
We support basic parallelization of the analysis. This is disabled by default but can be enabled either in the pom file
We support basic parallelization of the analysis. This is enabled by default but can be disabled either in the pom file
using the `<parallel>` option or by passing `-Drestrictimports.parallel` to the maven build.
```xml
<configuration>
Expand Down Expand Up @@ -345,7 +345,7 @@ java source file, creating an actual AST. This allows to also detect full qualif
considerably slower.

> **Warning**
> In case a source file cannot be properly parsed, we try to fall back to our _native_ line-by-line_ parsing
> In case a source file cannot be properly parsed, we try to fall back to our _native_ line-by-line parsing
> approach described [here](#syntactical-limitation). A respective warning will be issued in the
> report that is generated at the end.
>
Expand Down Expand Up @@ -408,6 +408,41 @@ statement. Thus if your `exclusion` pattern points to a concrete class like
with the exact name `ClassName.java`. The same applies in case you use a base package
pattern with no wild cards.

## Full configuration example
```xml
<RestrictImports>
<failBuild>true</failBuild> <!-- Can be overridden with -Drestrictimports.failBuild=... -->
<skip>false</skip> <!-- Can be overridden with -Drestrictimports.skip=... -->
<parseFullCompilationUnit>false</parseFullCompilationUnit>
<parallel>true</parallel> <!-- Can be overridden with -Drestrictimports.parallel=... -->
<excludedSourceRoots> <!-- Optional. Nesting not needed when specifying a excluded root -->
<excludedSourceRoot>\${project.build.directory}/generated-sources/main/java</excludedSourceRoot>
</excludedSourceRoots>
<groups>
<group> <!-- Optional. groups and group can be left out in simple configurations -->
<reason>...</reason>
<basePackages> <!-- Optional. Nesting not needed when specifying a single package -->
<basePackage>**</basePackage>
</basePackages>
<bannedImports> <!-- Optional. Nesting not needed when specifying a single package -->
<bannedImport>..</bannedImport>
</bannedImports>
<allowedImports> <!-- Optional. Nesting not needed when specifying a single package -->
<allowedImport>...</allowedImport>
</allowedImports>
</group>
</groups>
<notFixables> <!-- Optional. Nesting not needed when specifying a single not-fixable -->
<notFixable>
<in>**</in>
<allowedImports> <!-- Optional. Nesting not needed when specifying a single package -->
<allowedImport>..</allowedImport>
</allowedImports>
</notFixable>
</notFixables>
</RestrictImports>
```

## Configuration options

Overview of all configuration parameters:
Expand All @@ -418,12 +453,13 @@ Overview of all configuration parameters:
| `bannedImport(s)` | (List of) package pattern | yes | | |
| `allowedImport(s)` | (List of) package pattern | no | empty list | |
| `exclusion(s)` | (List of) package pattern | no | empty list | |
| `includeTestCode` | Boolean | no | `false` | `0.7.0` |
| `includeTestCode` | Boolean | no | `true` | `0.7.0` |
| `reason` | String | no | empty String | `0.8.0` |
| `failBuild` | Boolean | no | `true` | `0.17.0` |
| `skip` | Boolean | no | `false` | `0.17.0` |
| `includeCompileCode` | Boolean | no | `true` | `1.2.0` |
| `excludedSourceRoot(s)` | (List of) java.io.File | no | empty list | `1.3.0` |
| `parallel` | Boolean | no | `true` | `2.0.0` |
| `parseFullCompilationUnit` | Boolean | no | `false` | `2.1.0` |
| `notFixable(s)` | (List of) NotFixableDefinition | no | empty list | `2.4.0` |

Expand Down
2 changes: 1 addition & 1 deletion readme/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Maven Central](https://img.shields.io/static/v1?label=MavenCentral&message=${project.version}&color=blue)](https://search.maven.org/artifact/${project.groupId}/restrict-imports-enforcer-rule/${project.version}/jar) [![JavaDoc](https://img.shields.io/static/v1?label=JavaDoc&message=${project.version}&color=orange)](http://www.javadoc.io/doc/${project.groupId}/restrict-imports-enforcer-rule/${project.version})
[![Maven Central](https://img.shields.io/static/v1?label=MavenCentral&message=${project.version}&color=blue)](https://search.maven.org/artifact/${project.groupId}/restrict-imports-enforcer-rule/${project.version}/jar)

### Bug fixes
* [#55](https://github.com/skuzzle/restrict-imports-enforcer-rule/issues/55) Make parallel analysis the default
Expand Down

0 comments on commit 61a5884

Please sign in to comment.