fsfe / reuse-tool

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

Add support for Apache HTTP server ".htaccess" file and npm ".npmrc" file #985

Closed benoit-rolandeau-act closed 2 months ago

benoit-rolandeau-act commented 4 months ago

.htaccess

The .htaccess are configuration files for Apache HTTP server, see: https://httpd.apache.org/docs/2.4/en/howto/htaccess.html.

As written here:

[...] In general, .htaccess files use the same syntax as the main configuration files. [...]

Source: https://httpd.apache.org/docs/2.4/en/howto/htaccess.html

Those files have the same format as: https://httpd.apache.org/docs/2.4/en/configuring.html#syntax. In this page it is said:

[...] Lines that begin with the hash character "#" are considered comments, and are ignored. Comments may not be included on the same line as a configuration directive. White space occurring before a directive is ignored, so you may indent directives for clarity. Blank lines are also ignored. [...]

Source: https://httpd.apache.org/docs/2.4/en/configuring.html#syntax

Therefore, I think the class to use is: PythonCommentStyle.

.npmrc

The .npmrc are npm config files, see: https://docs.npmjs.com/cli/v10/configuring-npm/npmrc.

As written here:

[...] All npm config files are an ini-formatted list of key = value parameters. [...] Lines in .npmrc files are interpreted as comments when they begin with a ; or # character. .npmrc files are parsed by npm/ini, which specifies this comment syntax. [...]

Source: https://docs.npmjs.com/cli/v10/configuring-npm/npmrc

Therefore, I think the classes to use could be: SemicolonCommentStyle or PythonCommentStyle. But because, the file is an ini file and we chose SemicolonCommentStyle for ini files, the best is to do the same and use SemicolonCommentStyle.

benoit-rolandeau-act commented 4 months ago

I will do the update.

benoit-rolandeau-act commented 4 months ago

Done, ready to be reviewed