iwarapter / sonar-puppet

SonarQube plugin for Puppet code.
Other
26 stars 10 forks source link

Support 'custom file server mount point' (by configuration) #274

Open axel3rd opened 7 years ago

axel3rd commented 7 years ago

Hello,

The puppet:PuppetURLModules is a relevant rule, but as explain in linked Puppet File Server Guide:

Generally, files are stored in modules. But if you need to serve larger files that shouldn’t be in source control or shouldn’t be distributed with a module, you can make a custom file server mount point and let Puppet serve those files from another directory.

In a company with large Puppet Master and some categorizations, this customization could be useful.

In complement of #150 ('modules' pattern & variables), having some SonarQube plugin configuration about that could allow this case:

source => "puppet:///company-foo/...
source => "puppet:///company-bar/...

Formalization with SonarQube plugin property usage:

@Properties({ @Property(
    key = sonar.puppet.mount.points, 
    name = "Adding file server mount points", 
    type = PropertyType.STRING, 
    description = "Comma-separated list of additional mount points for 'PuppetURLModules' check; in complement of 'modules' and variable usage."
) })

I can provide a PR if feature considered as relevant.

Best regards

coxifred commented 7 years ago

+1

axel3rd commented 7 years ago

Formalization with SonarQube plugin property usage: @Properties({ @Property(

Perhaps a @RuleProperty is more simple ...