Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add suggestion to default errorMessage on how to fix missing/wrong license headers #531

Closed
scordio opened this issue Apr 1, 2023 · 2 comments · Fixed by #533
Closed
Labels
is:feature New feature

Comments

@scordio
Copy link
Contributor

scordio commented Apr 1, 2023

Describe the feature

Currently, I define a check execution in my projects to make sure each file has the proper license header and I let the CI fail if something is missing. This gives immediate feedback in PRs but the default error message doesn't give indications on how to fix the problem.

Without guidance, it's assumed that the PR author is or needs to get familiar with the license-maven-plugin, which is not always the case, especially for one-time contributors.

The project-specific contributing guidelines could contain some details about the license headers and how to fix the missing ones but I believe it would be more effective to have guidance directly in the error message. For this reason, I propose to define the default error message like the following:

Some files do not have the expected license header. Run license:format to update them.

I'm happy to raise a PR if the idea is accepted.

Any alternative you've considered ?

To give direct feedback to users, I currently define a custom error message with the content above:

<configuration>
  <errorMessage>Some files do not have the expected license header. Run license:format to update them.</errorMessage>
</configuration>
@scordio scordio added the is:feature New feature label Apr 1, 2023
@hazendaz
Copy link
Collaborator

hazendaz commented Apr 1, 2023 via email

@scordio
Copy link
Contributor Author

scordio commented Apr 1, 2023

Sure, here it is:

Some files do not have the expected license header

Taken from:

@Parameter(property = "license.errorMessage", defaultValue = "Some files do not have the expected license header")
public String errorMessage = "Some files do not have the expected license header";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is:feature New feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants