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

build: add copyright header checks using maven checkstyle plugin #5649

Merged
merged 11 commits into from
Jan 16, 2025

Conversation

mattdibi
Copy link
Contributor

@mattdibi mattdibi commented Jan 16, 2025

This PR introduces the check for copyright headers consistency leveraging the maven checkstyle plugin.

Details: with this PR we're now leveraging the RegexpHeader check implemented by the maven checkstyle plugin. The checkstyle plugin now checks whether the header of the file matches the regex contained in the newly introduced header.txt file in the root directory.

Please be aware that the check won't notify the developer of the need to update the copyright year when the file is edited. This type of check is not available in the checkstyle plugin (we would need to know which files with respect to the develop branch, probably a CI of sorts is better suited for the task).


While working on this check I found out a file that was not matching our current license. The file is the following:

* are made available under the terms of the Eclipse Public License v1.0

introduced in #3377 by @srware.

I took the chance to update the licence to EPL2.0 for consistency with the rest of the project. and in accordance to Eclipse Foundation guidelines (see: a29bec7)

Referring to the FAQ I would like to ask @srware whether they're OK with us updating the license of the above-mentioned file.

@srware
Copy link
Contributor

srware commented Jan 16, 2025

@mattdibi , I am happy for this update to go ahead.

@mattdibi
Copy link
Contributor Author

@srware Thanks for the quick feedback, this is greatly appreciated! 🙏

@mattdibi mattdibi marked this pull request as ready for review January 16, 2025 13:17
@MMaiero MMaiero self-requested a review January 16, 2025 13:40
@mattdibi mattdibi merged commit ca95dd7 into develop Jan 16, 2025
4 checks passed
@mattdibi mattdibi deleted the ci/checkstyle_copyright_header branch January 16, 2025 14:52
@salvatore-coppola
Copy link
Contributor

@mattdibi there's a side issue, since the checkstyle_checks.xml file refers to the https://github.com/eclipse-kura/kura/blob/ca95dd7a2e92ae50999c89bef3847193da2c83f0/header.txt file that is in the root directory, the execution in sub-modules and in the target platform results in an error (the plugin doesn't find the header file).

The problem is very annoying because now it's impossible to build the target platform or a single bundle inside the related folder.
I tried to fix it quickly but I failed, do you have any idea ?

@mattdibi
Copy link
Contributor Author

@salvatore-coppola I'm going to revert the checkstyle change ASAP. The current approach is not working as intended, has low coverage and doesn't scale with all our projects. A better/different approach is required.

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

Successfully merging this pull request may close these issues.

4 participants