-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Print lint warnings #4761
Print lint warnings #4761
Conversation
3d98105
to
0ed1a23
Compare
c56ebda
to
51b246b
Compare
Signed-off-by: Talon Bowler <[email protected]>
51b246b
to
72d7aa7
Compare
return res, nil | ||
} | ||
|
||
func PrintLintViolations(dt []byte, w io.Writer) error { |
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.
@colinhemmings Any comments about the output here?
f5fa4fd
to
aec4bda
Compare
Signed-off-by: Talon Bowler <[email protected]>
aec4bda
to
81fc6a3
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.
PTAL some failed validation in CI as well.
ced11ee
to
543112e
Compare
@tonistiigi Ready for a second review, at your leisure! 😃 |
543112e
to
c772ed1
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.
Follow-up: The lint results and the warning summary in progressbar can appear out of order atm and warnings from later lines appearing after warning from first line. I think we should sort them based on the source code location before showing in a list.
fmt.Fprintf(tw, "\t%s:%d\n", source.Filename, firstRange.Start.Line) | ||
} | ||
fmt.Fprintf(tw, "\t%s\n", warning.Detail) | ||
for _, r := range warning.Location.Ranges { |
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.
Follow-up:
The source stacktrace doesn't seem to match the style in the progressbar:
Lint Rule FromAsCasing
Dockerfile:1
Lint Rule 'FromAsCasing': 'as' and 'FROM' keywords' casing do not match (line 1)
1 | FROM alpine as Base
- Lint Rule 'FromAsCasing': 'as' and 'FROM' keywords' casing do not match (line 1)
The 'as' keyword should match the case of the 'from' keyword
Dockerfile:1
--------------------
1 | >>> FROM alpine as Base
2 | RUN apk add git
3 | workdir /
--------------------
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.
Also, note that this description part is missing in print output. Is this intentional?
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.
It ended up being a lot of redundant information displayed and looked pretty cluttered. That being said, getting them to match the much superior progressbar style is an EXCELLENT idea. 😂
Signed-off-by: Talon Bowler <[email protected]>
c772ed1
to
e81c6c6
Compare
Following on the footsteps of #4759, this adds support for an additional subrequest frontends can choose to implement for exposing linting errors and implements this subrequest for the
dockerfile
frontend.