volodya-lombrozo / conventional-commit-linter Goto Github PK
View Code? Open in Web Editor NEWConventional Commit Linter - plugin for Maven projects https://www.conventionalcommits.org/en/v1.0.0-beta.4/
License: MIT License
Conventional Commit Linter - plugin for Maven projects https://www.conventionalcommits.org/en/v1.0.0-beta.4/
License: MIT License
CheckStyle linter should be added to the project.
https://checkstyle.sourceforge.io/
Currently, we don't break the process if the validation of the git message was unsuccessful. For that reason, we get strange behavior.
For example, we could get the next validation result (failed):
com.github.volodya_lombrozo.conventional_commit_linter.exceptions.InvalidCommit: Commit GitCommit[message='add conventional commit plugin'] not matches with the next format: ConventionalFormat[Allowed types=(feat, fix, style, test, refactor, docs, chore), Version https://www.conventionalcommits.org/en/v1.0.0-beta.4/] . Please, change the commit formatting.
But validation phase will be finished successfully:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
We definitely should throw an Exception if validation failed.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
.github/workflows/maven.quality.yml
actions/checkout v4
actions/setup-java v3
actions/cache v3
codecov/codecov-action v3.1.4
.github/workflows/maven.release.yml
actions/checkout v4
actions/setup-java v3
actions/cache v3
pom.xml
org.apache.maven:maven-plugin-api 3.9.5
org.apache.maven:maven-core 3.9.5
org.apache.maven:maven-artifact 3.9.5
org.apache.maven:maven-compat 3.9.5
org.apache.maven:maven-model 3.9.5
org.apache.maven.plugin-tools:maven-plugin-annotations 3.10.1
org.apache.maven.shared:maven-invoker 3.2.0
org.apache.maven.plugin-testing:maven-plugin-testing-harness 3.3.0
junit:junit 4.13.2
org.mockito:mockito-all 1.10.19
org.apache.maven.plugins:maven-plugin-plugin 3.10.1
org.apache.maven.plugins:maven-checkstyle-plugin 3.3.1
com.puppycrawl.tools:checkstyle 10.12.4
org.jacoco:jacoco-maven-plugin 0.8.10
org.apache.maven.plugins:maven-javadoc-plugin 3.6.0
org.apache.maven.plugins:maven-source-plugin 3.3.0
org.apache.maven.plugins:maven-gpg-plugin 3.1.0
org.sonatype.plugins:nexus-staging-maven-plugin 1.6.13
Currently, the plugin configuration requires cerain phase row:
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>scan</goal>
</goals>
</execution>
</executions>
It's a bit inconvenient to use. We must set the default phase as validate for example.
The plugin is almost silent. It writes only few lines:
[INFO] Conventional commit validation phase started
[INFO] Conventional commit validation passed
It does not provide any additional information. We should improve the logging system. And provide more information about the scan process.
By default, the plugin works with mode "NOTHING".
In README documentation "ALL" mode is present as default.
It seems strange to me. More frequent case to use the "LAST" mode.
It must be set as a default mode in the README file and in the plugin itself.
I was running plugin with the next configuration:
<plugin>
<groupId>com.github.volodya-lombrozo</groupId>
<artifactId>conventional-commit-linter</artifactId>
<version>0.0.2</version>
<configuration>
<scan>LAST</scan>
</configuration>
<executions>
<execution>
<goals>
<goal>scan</goal>
</goals>
</execution>
</executions>
</plugin>
And I got the next exception:
Caused by: java.util.NoSuchElementException
at java.util.LinkedList.getLast (LinkedList.java:261)
at com.github.volodya_lombrozo.conventional_commit_linter.git.GitCommits.last (GitCommits.java:33)
at com.github.volodya_lombrozo.conventional_commit_linter.validator.LastCommitValidator.validate (LastCommitValidator.java:36)
at com.github.volodya_lombrozo.conventional_commit_linter.ValidateMojo.execute (ValidateMojo.java:26)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
As I understand problem could be related to the empty collection returned by GitCommits
class.
When scan is set to 'LAST' and there's no commits made yet plugin's execution stops maven build lifecycle
Expected behaviour seems to simply miss any validation
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.