Skip to content
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 lint report, clean up coverage report #37

Merged
merged 12 commits into from
Mar 31, 2022
Merged

Add lint report, clean up coverage report #37

merged 12 commits into from
Mar 31, 2022

Conversation

leizor
Copy link
Contributor

@leizor leizor commented Mar 25, 2022

This PR adds a lint report on top of the existing coverage report as well as cleaning up the interaction a bit:

  • Old reports are now hidden and classified as outdated
  • The reports now start folded within the PR comment

@grafanabot

This comment has been minimized.

Copy link
Contributor

@ywwg ywwg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great, and the output is really nice now! thank you. Just a note on formatting, and the linter has some comments for you as well :)

panic(err)
}

commentTypeIdentifier := flag.String("i", "", "String that identifies the comment type being submitted")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefer verbose flag names so they aren't as cryptic

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do!

return v
}

func minimizeOutdatedComments(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did the go formatter produce this output? The Go standard is to just let the line be very long. If you don't run gofmt by default, please do.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I had it setup to run on every ctrl+s but I guess it might be doing a Goland-specific formatting instead - will do!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from googling around I think the goland formatting is a bit non-standard. If it seems to insist on this formatting, there seems to be a way to force it to use gofmt instead: https://stackoverflow.com/questions/47735678/goland-how-to-use-gofmt

I'm mostly trying to avoid a formatter war where prs keep reformatting the same code over and over


for _, comment := range prComments {
if comment.Author.Login == CommenterLogin &&
strings.Contains(comment.Body, commentTypeIdentifier) &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, this should just be a long line

@grafanabot

This comment has been minimized.

@ywwg
Copy link
Contributor

ywwg commented Mar 29, 2022

still some lint complaints -- also in the transmog repo, the lint is run as part of an automated check that can block merging. Personally I like the method you've used better, but other people might prefer consistency with our other repos. (I think we've done enough on this CI/CD stuff and should change focus to the auth stuff)

@grafanabot

This comment has been minimized.

@grafanabot

This comment has been minimized.

@grafanabot

This comment has been minimized.

@leizor leizor requested a review from ywwg March 29, 2022 17:24
@ywwg
Copy link
Contributor

ywwg commented Mar 30, 2022

If the lint report is empty, can we print a happy message instead of an empty twirl-down? 😆

@grafanabot

This comment has been minimized.

@grafanabot

This comment has been minimized.

@grafanabot

This comment has been minimized.

@grafanabot

This comment has been minimized.

@grafanabot

This comment has been minimized.

@grafanabot
Copy link

Go coverage report:

Click to expand.
File %
github.com/grafana/influx2cortex/pkg/errorx/errors.go 67.3%
github.com/grafana/influx2cortex/pkg/errorx/http_translator.go 100.0%
github.com/grafana/influx2cortex/pkg/influx/api.go 95.0%
github.com/grafana/influx2cortex/pkg/influx/errors.go 100.0%
github.com/grafana/influx2cortex/pkg/influx/parser.go 83.8%
github.com/grafana/influx2cortex/pkg/influx/recorder.go 100.0%
github.com/grafana/influx2cortex/pkg/remotewrite/client.go 69.1%
github.com/grafana/influx2cortex/pkg/remotewrite/measured_client.go 88.9%
github.com/grafana/influx2cortex/pkg/remotewrite/recorder.go 100.0%
github.com/grafana/influx2cortex/pkg/tenant/resolver.go 75.6%
github.com/grafana/influx2cortex/pkg/tenant/tenant.go 91.7%
github.com/grafana/influx2cortex/pkg/util/extract_forwarded.go 66.7%
github.com/grafana/influx2cortex/pkg/util/http.go 68.3%
github.com/grafana/influx2cortex/pkg/util/log/experimental.go 0.0%
github.com/grafana/influx2cortex/pkg/util/log/log.go 0.0%
github.com/grafana/influx2cortex/pkg/util/log/rate_limit.go 90.0%
github.com/grafana/influx2cortex/pkg/util/log/wrappers.go 0.0%
github.com/grafana/influx2cortex/pkg/util/push/push.go 60.0%
total 73.1%

Go lint report:

No issues found. 😎

@leizor
Copy link
Contributor Author

leizor commented Mar 31, 2022

@ywwg I think I've got everything fixed up for this PR--let me know if I've missed anything!

Copy link
Contributor

@ywwg ywwg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@leizor leizor merged commit e3a2b1c into main Mar 31, 2022
@leizor leizor deleted the leizor/linter-2 branch March 31, 2022 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants