fsfe / reuse-tool

reuse is a tool for compliance with the REUSE recommendations.
https://reuse.software
382 stars 146 forks source link

comment: C, Cpp and Css styles reorganization (big) #941

Closed Thannoy closed 2 months ago

Thannoy commented 5 months ago

C and C++ features different comment styles:

For this reason, multi-line /* */ is often named C-style comment and single-line // is often named C++-style comment.

In current implementation, there were only a "CCommentStyle" with /* */ and // support, used for both C and C++ files (also used by quite many other file types).

Therefore:

Caution:

This PR is a little bit big but in my opinion results in a clearer handling of C/C++ (and Css).

Thannoy commented 5 months ago

Another caution about this PR: since it touches quite many places, conflicts with other PRs are likely.

Thannoy commented 2 months ago
Thannoy commented 2 months ago

For information purpose, resyncing this PR with master updates is not that trivial. Here is my workflow:

carmenbianca commented 2 months ago

Hi @Thannoy and thanks! I rebased on top of master again, and did some more adjusting. To maintain support for the old shorthands, I manually added them to the dictionary and added tests for this.

This PR is technically a breaking change still, but I can live with that.

Thanks for the work and the history context.