-
Notifications
You must be signed in to change notification settings - Fork 94
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
WIP: feat(lint): add troubleshoot lint #1532
base: main
Are you sure you want to change the base?
Conversation
@@ -38,6 +42,38 @@ import ( | |||
|
|||
func runTroubleshoot(v *viper.Viper, args []string) error { | |||
ctx := context.Background() | |||
if len(args) == 1 && args[0] == "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.
I assume you implemented this subcommand this way cause its a WIP PR, right?
I would have expected lint
to be a cobra subcommand
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.
Yes, it is a WIP PR for showing what lint could be like. Sure, I will put it into cmd/lint
as a cobra subcommand
|
||
analyzeFieldsInLowerCamelCase := strings.ToLower(strings.Join(analyzerFields, " ")) | ||
|
||
for _, n := range node.Content[0].Content { // Traverse the root map |
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.
The idea you have with validating and reporting is correct, I'm however not sure we want to implement this feature by parsing yaml and inspecting fields like this. We'll be reinventing the wheel. There are a number of libraries that already exist that utilize yaml/json/openapi spec annotations. I've listed a few in #871 issue.
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.
great! I will have a look. In the meanwhile, I am checking the product team to see what their opinions. We can discuss the output of this command together.
36f4fd6
to
0cb775a
Compare
Description, Motivation and Context
troubleshoot lint
It will return a error and tips
Screenshot:
In a more complicated case like
it will return
sc-103245
Checklist
Does this PR introduce a breaking change?