Add new command inventory lint#400
Conversation
Currently the only implemented linting error is warning about component specifications without explicit version.
d887245 to
644dbbf
Compare
644dbbf to
60433c4
Compare
glrf
left a comment
There was a problem hiding this comment.
LGTM.
I would have structured the CLI differently, but that's probably personal preference,
| def inventory_lint(config: Config, verbose): | ||
| config.update_verbosity(verbose) |
There was a problem hiding this comment.
Could we make this command lint everything (i.e. execute all it's sub commands)?
I pretty much never want to just check for one type of issues. I would want commodore to just lint my inventory. I don't want to run a command to check if there are components without versions, then another one check for a different issue, etc.
There was a problem hiding this comment.
Not sure if that's possible with the current structure, but we can certainly refactor the CLI to just provide inventory lint and then options to enable or disable individual linters. Thinking about it again, that probably makes more sense than my current approach.
There was a problem hiding this comment.
Changed the CLI to just provide inventory lint. We can always add flags to enable or disable individual linters once we have more than one.
corvus-ch
left a comment
There was a problem hiding this comment.
I fail to understand where that linting would be executed.
Anywhere you can run Commodore really. This can be useful locally to check that you didn't introduce an unsupported configuration, or in CI for a global or tenant repo to catch unsupported configs before they get merged to the main branch. |
inventory lint componentsinventory lint
glrf
left a comment
There was a problem hiding this comment.
Maybe I'm completely misunderstanding how this should work, but it seems like you're missing a flag declaration?
Only provide `inventory lint`. We can introduce flags to control which linters are enabled once we have more than one.
efc67a4 to
ca753d0
Compare
Currently the only implemented linting error is warning about component specifications without explicit version.
Checklist
bug,enhancement,documentation,change,breaking,dependencyas they show up in the changelog