-
Notifications
You must be signed in to change notification settings - Fork 154
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
Enable more linters #252
Enable more linters #252
Conversation
Codecov Report
@@ Coverage Diff @@
## master #252 +/- ##
==========================================
- Coverage 19.69% 19.42% -0.28%
==========================================
Files 10 10
Lines 2178 2193 +15
==========================================
- Hits 429 426 -3
- Misses 1725 1742 +17
- Partials 24 25 +1
Continue to review full report at Codecov.
|
- path: server/webhook.go | ||
linters: | ||
- goconst |
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.
There are so many action types like "opened"
in server/webhook.go
that refactoring them into const
's did make the code more readable.
go.mod
Outdated
require ( | ||
github.com/Masterminds/sprig/v3 v3.0.2 | ||
github.com/google/go-github/v25 v25.1.1 | ||
github.com/Masterminds/sprig/v3 v3.1.0 | ||
github.com/google/go-github/v31 v31.0.0 | ||
github.com/gorilla/mux v1.7.4 | ||
github.com/mattermost/mattermost-server/v5 v5.18.0 | ||
github.com/pkg/errors v0.8.1 | ||
github.com/stretchr/testify v1.4.0 | ||
github.com/mattermost/mattermost-server/v5 v5.22.0 | ||
github.com/mholt/archiver/v3 v3.3.0 | ||
github.com/pkg/errors v0.9.1 | ||
github.com/stretchr/testify v1.5.1 |
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 did also include an dependency update into this PR to help keep the number of PRs QA has to review low.
func (p *Plugin) CreateBotDMPost(userID, message, postType string) *model.AppError { | ||
// CreateBotDMPost posts a direct message using the bot account. | ||
// Any error are not returned and instead logged. | ||
func (p *Plugin) CreateBotDMPost(userID, message, postType string) { |
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.
Omitting the returned error and logging it instead just make the caller code simplere.
server/template_test.go
Outdated
@@ -360,7 +359,7 @@ func TestPushedCommitsTemplate(t *testing.T) { | |||
Repo: &pushEventRepository, | |||
Sender: &user, | |||
Forced: bToP(true), | |||
Commits: []github.PushEventCommit{ | |||
Commits: []*github.HeadCommit{ |
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.
github.PushEventCommit
was removed from github.com/google/go-github
. It's just a naming change.
@bakurits Given that you touched a lot of the code base lately, a review from you would be appreciated. |
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.
Looks great. Just some minor comments.
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
Waiting to merge some community PRs to not cause to many merge conflicts. |
Codecov Report
@@ Coverage Diff @@
## master #252 +/- ##
==========================================
- Coverage 18.50% 18.13% -0.37%
==========================================
Files 10 10
Lines 2340 2371 +31
==========================================
- Hits 433 430 -3
- Misses 1883 1916 +33
- Partials 24 25 +1
Continue to review full report at Codecov.
|
@DHaussermann This PR is ready for review. Given a lot of files got touched, please do a general test. Especially take a look at the interaction between the webapp and server, e.g. creating issue, RHS, LHS, etc. |
@DHaussermann The testing for this PR and the testing for the release are basically the same: Test everything. With that in mind, I'm wondering if you would be fine merging the PR as it is. By merging early double testing gets avoided. |
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.
Tested and passed
- No issues with build or deploy
- Briefly smoke tested focusing on LHS, RHS and post menu options
- No issues found
LGTM!
No changes need to release testing.
Summary
This PR sync the
golangci-lint
config with the one from other repos. Hence, a lot of new linter got enabled. The config file is synced with mattermost/mattermost-plugin-starter-template#90.Given the high number of changed lines, I tried to break the changes into multiple commits.
While most changes are just stylistic, I did comment on the more tricky one.
Ticket Link
Follow up on mattermost-community/mattermost-plugin-autolink#108