Skip to content

Config file usage #362

@KamasamaK

Description

@KamasamaK

I was struggling a bit with getting the JSON configuration file to work, and here is what I found.

  1. When/How should this rule config file read? Should it always be looked for when scanning a file or only for a folder?
  2. Is the file type that is looked for during scan the same as the one passed in the command line as configfile?

My take:
I would say that the way it should work is that it should always look for that file when scanning regardless of whether it's a file or folder. Also, I would expect that if you passed a file as the configfile through the command line that it would process like the project config.

This is what I've found looking briefly through the code:
According to com.cflint.config.CFLintConfig, both excludes and includes are lists of com.cflint.config.CFLintPluginInfo.PluginInfoRule.PluginMessage. This is also somewhat supported by the documentation. I've been unable to get it to work this way through the command line. From what I can gather, the reason that didn't work and to address item 2. above is that it looks like the JSON config file is unmarshalled to com.cflint.config.CFLintPluginInfo from the command line, whereas the XML format can be either.

Correct me on anything I got wrong, but let's discuss how it does and should work. I think we need to address all of these before deprecating the XML formatted config and certainly should make it clear if the command line's config file is different.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions