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

golangci-lint workflow #262

Merged
merged 19 commits into from
Sep 29, 2021
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
3dd8ec4
draft golangci-lint workflow
uturunku1 Sep 22, 2021
222fe15
fix gh action error that says every step must define a or key
uturunku1 Sep 22, 2021
e8279f2
1.42.1 is an invalid version
uturunku1 Sep 22, 2021
6bfaa45
temporarily commenting the option only-new-issues to correct old issues
uturunku1 Sep 22, 2021
e14e068
apply golangci-lint recommendations: remove unused code which is ever…
uturunku1 Sep 22, 2021
08332ca
add back file because its functions are being used, is just that gola…
uturunku1 Sep 22, 2021
9f58003
add flag to ignore test files
uturunku1 Sep 22, 2021
5b21f13
add yml for golangci configuration and add setting to ignore unused f…
uturunku1 Sep 23, 2021
13c20e5
remove extra lines
uturunku1 Sep 28, 2021
413f623
pin to version 1.29 to compare behaviour with version 1.40
uturunku1 Sep 28, 2021
3c44683
enable some useful lint libraries and use go version 1.16 and golangc…
uturunku1 Sep 28, 2021
be0ed9d
golangci-lint library recommends to stop using golint because it is d…
uturunku1 Sep 28, 2021
771ab13
fix new issues point by golangci-lint
uturunku1 Sep 28, 2021
cabf350
clarify comment on why we are not using golint
uturunku1 Sep 28, 2021
1689acd
enable other lint libraries that I liked their description and add ad…
uturunku1 Sep 29, 2021
a573060
add configuration to golangci-lint and fix errors mentioned by enable…
uturunku1 Sep 29, 2021
2e17d84
remove not useful comments
uturunku1 Sep 29, 2021
1cb63d4
match lowercase in tests
uturunku1 Sep 29, 2021
8b80493
missing test
uturunku1 Sep 29, 2021
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
17 changes: 17 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: golangci-lint
on:
push:
branches:
- main
pull_request:
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: latest
#only-new-issues: true
12 changes: 12 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
run:
timeout: 5m
issues:
exclude-rules:
- path: _test\.go
linters:
- unused
- deadcode



uturunku1 marked this conversation as resolved.
Show resolved Hide resolved

2 changes: 1 addition & 1 deletion admin_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ type AdminUserListOptions struct {

// List all user accounts in the Terraform Enterprise installation
func (a *adminUsers) List(ctx context.Context, options AdminUserListOptions) (*AdminUserList, error) {
u := fmt.Sprintf("admin/users")
u := "admin/users"
req, err := a.client.newRequest("GET", u, &options)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/hashicorp/go-uuid"
)

const badIdentifier = "! / nope"
const badIdentifier = "! / nope" //nolint

// Memoize test account details
var _testAccountDetails *TestAccountDetails
Expand Down