+
Skip to content

Set up workflow for golangci #2020

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

Merged
merged 10 commits into from
Aug 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
on: [push, pull_request]
name: linter

jobs:
lint:
strategy:
matrix:
go-version: [1.x]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v2

- name: golangci-lint
uses: golangci/golangci-lint-action@5c56cd6c9dc07901af25baab6f2b0d9f3b7c3018 #v2.5.2
with:
version: v1.41
args: --verbose
32 changes: 32 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
linters:
# TODO: fix errors so that all of the linters below pass.
# The linters that are commented out, as well as those explicitly disabled,
# are currently failing. We should fix those failures or define exclusion
# rules, and then enable those linters.
enable:
- dogsled

Choose a reason for hiding this comment

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

suggest to add ercheck and govet to the list
https://golangci-lint.run/usage/linters/

Copy link
Contributor Author

@mmorel-35 mmorel-35 Aug 18, 2021

Choose a reason for hiding this comment

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

Those two are active by default, see https://golangci-lint.run/usage/linters/#enabled-by-default-linters. I haven't deactivated them. It would require disable-all to be true under the linters item in this case
https://golangci-lint.run/usage/configuration/#config-file

- dupl
- gofmt
- goimports
# - gosec
- misspell
- nakedret
# - stylecheck
# - unconvert
# - unparam
# - whitespace
disable:
- errcheck
- gosimple
- staticcheck
- ineffassign
- unused
issues:
exclude-rules:
- linters:
- dogsled
text: "declaration has 3 blank identifiers"
path: _test\.go
- linters:
- dupl
path: _test\.go
2 changes: 1 addition & 1 deletion github/activity_notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type NotificationListOptions struct {
//
// GitHub API docs: https://docs.github.com/en/free-pro-team@latest/rest/reference/activity/#list-notifications-for-the-authenticated-user
func (s *ActivityService) ListNotifications(ctx context.Context, opts *NotificationListOptions) ([]*Notification, *Response, error) {
u := fmt.Sprintf("notifications")
u := "notifications"
u, err := addOptions(u, opts)
if err != nil {
return nil, nil, err
Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载