From a10f81d20acaa0e437f4d6cb464aed1851e2c447 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Wed, 21 Jul 2021 23:12:20 +0200 Subject: [PATCH 01/10] Create linter.yml --- .github/workflows/linter.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/linter.yml diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 00000000000..1f87c86d5de --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,18 @@ +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@v2 + with: + version: v1.41 From bc0d17588f9dfae42a92e383f1aa92e757b9a2ad Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Wed, 21 Jul 2021 23:14:35 +0200 Subject: [PATCH 02/10] Create .golangci.yml --- .golangci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .golangci.yml diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 00000000000..112c8179e99 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,13 @@ +linters: + enable: + - dogsled + - dupl + - gofmt + - goimports + - gosec + - misspell + - nakedret + - stylecheck + - unconvert + - unparam + - whitespace From 3310cc256eb4d116a8b7cc43c2b4be203dcd18ed Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Wed, 18 Aug 2021 19:15:04 +0200 Subject: [PATCH 03/10] Update linter.yml --- .github/workflows/linter.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 1f87c86d5de..9b19016ffa0 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -16,3 +16,4 @@ jobs: uses: golangci/golangci-lint-action@v2 with: version: v1.41 + args: --verbose From 360f22549b535346f118131a20b056603dc3b7dc Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Wed, 18 Aug 2021 19:18:40 +0200 Subject: [PATCH 04/10] Update linter.yml --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 9b19016ffa0..c01eed67cf0 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -16,4 +16,4 @@ jobs: uses: golangci/golangci-lint-action@v2 with: version: v1.41 - args: --verbose + args: --verbose --issues-exit-code=0 From 2d6f19103d2d080166ce6a370dccf4cedeb0df72 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Wed, 18 Aug 2021 19:45:20 +0200 Subject: [PATCH 05/10] Update .github/workflows/linter.yml Co-authored-by: Will Norris --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index c01eed67cf0..8f38e25d089 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v2 - name: golangci-lint - uses: golangci/golangci-lint-action@v2 + uses: golangci/golangci-lint-action@5c56cd6c9dc07901af25baab6f2b0d9f3b7c3018 #v2.5.2 with: version: v1.41 args: --verbose --issues-exit-code=0 From 6cc057d7afbdcec014f315078e650fcd585dda9c Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Wed, 18 Aug 2021 20:15:08 +0200 Subject: [PATCH 06/10] remove --issues-exit-code=0 --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 8f38e25d089..5f35fac3f0b 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -16,4 +16,4 @@ jobs: uses: golangci/golangci-lint-action@5c56cd6c9dc07901af25baab6f2b0d9f3b7c3018 #v2.5.2 with: version: v1.41 - args: --verbose --issues-exit-code=0 + args: --verbose From 017b24ba86f0f74421402eff99a58a9bd9d4c40f Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Wed, 18 Aug 2021 20:42:29 +0200 Subject: [PATCH 07/10] Update .golangci.yml --- .golangci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index 112c8179e99..f9b5ea7fab9 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -11,3 +11,12 @@ linters: - unconvert - unparam - whitespace +issues: + exclude-rules: + - linters: + - dogsled + text: "declaration has 3 blank identifiers" + path: _test\.go + - linters: + - dupl + path: _test\.go From 6c12fad6bae9abacd021888257a016f508950aa2 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Wed, 18 Aug 2021 22:18:11 +0200 Subject: [PATCH 08/10] Update activity_notifications.go --- github/activity_notifications.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/activity_notifications.go b/github/activity_notifications.go index 9b6fbe2b58e..009cc5e32a8 100644 --- a/github/activity_notifications.go +++ b/github/activity_notifications.go @@ -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 From b003a5cd3abe230af0251306fc3afc53c7456e78 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Thu, 19 Aug 2021 00:31:24 +0200 Subject: [PATCH 09/10] Update .golangci.yml --- .golangci.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index f9b5ea7fab9..52c1f889f08 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -4,13 +4,19 @@ linters: - dupl - gofmt - goimports - - gosec + # - gosec - misspell - nakedret - - stylecheck - - unconvert - - unparam - - whitespace + # - stylecheck + # - unconvert + # - unparam + # - whitespace + disable: + - errcheck + - gosimple + - staticcheck + - ineffassign + - unused issues: exclude-rules: - linters: From 4bcc57b09b83982e8ed60df53dde04fc49959aa2 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Thu, 19 Aug 2021 00:35:26 +0200 Subject: [PATCH 10/10] Update .golangci.yml --- .golangci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index 52c1f889f08..afd9675f2f8 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,4 +1,8 @@ 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 - dupl