v0.0-297-g751d4d8: PR #229: Allow lint configuration to be placed in files
I am opening this early to ask for comments.
Some general info:
* The configuration from file is read after setting up the default configs, but before parsing the invocation arguments. This way the arguments can easily overwrite the configuration from the file
* I think the following should be considered (all of them should be optional):
* a global configuration file (e.g. `~/.verible_lint.rules`)
* a local configuration file (e.g. the top directory of a project), this assumes the linter is executed from the top dir of the project
* any arbitrary file, specified with an argument
* If we decide to use all of the options listed above we could:
* combine the global file, local file and file from a flag (in that order), or
* ignore global file if a local one exists, ignore both if another one is specified with a flag
* always overwrite the config from files when the same flags are specified with the `-rules` switch
* for now the implementation does some string operations on the file to make the format compatible with the arguments format. The only difference is the settings can be put in separate lines to improve readability. Thanks to this we can reuse the same parsing code
Other options to consider:
* use a completely different format for the configuration (e.g. ini files, with a general `[rules]` section, and more rule-specific configuration)
Please share your thoughts.
CC @hzeller
GitHub PR https://github.com/google/verible/pull/229
Copybara import of the project:
- 776ca4e4fb9049602175e6ab72e7c31d950b2b42 Allow lint configuration to be placed in files by Tomasz Gorochowik <[email protected]>
Closes #229
PiperOrigin-RevId: 301922115