-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I would have structured the CLI differently, but that's probably personal preference,
commodore/cli.py
Outdated
def inventory_lint(config: Config, verbose): | ||
config.update_verbosity(verbose) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 components
inventory lint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
,dependency
as they show up in the changelog