Giter Site home page Giter Site logo

conventional-commit-linter's People

Contributors

renovate[bot] avatar volodya-lombrozo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

conventional-commit-linter's Issues

Fail maven process after failed validation

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.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.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
maven
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

  • Check this box to trigger a request for Renovate to run again on this repository

Add default phase

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.

Informative logging

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.

Change default mode to the "LAST"

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.

GitCommits returns empty commits collection

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.