Skip to content
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
22 changes: 9 additions & 13 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,22 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Set up Go 1.19
uses: actions/setup-go@v6
with:
go-version: 1.19

- name: Check out code
uses: actions/checkout@v6
with:
persist-credentials: false

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: 'stable'

- name: Verify dependencies
env:
LINT_VERSION: 1.50.1
run: |
go mod verify
go mod download

curl -fsSL https://github.com/golangci/golangci-lint/releases/download/v${LINT_VERSION}/golangci-lint-${LINT_VERSION}-linux-amd64.tar.gz | \
tar xz --strip-components 1 --wildcards \*/golangci-lint
mkdir -p bin && mv golangci-lint bin/

- name: Run checks
run: bin/golangci-lint run --out-format=github-actions
- name: golangci-lint
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
version: v2.11.0
35 changes: 25 additions & 10 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
version: "2"

linters:
default: standard
enable:
- gofmt
- godot
- revive
settings:
errcheck:
exclude-functions:
- fmt.Fprint
- fmt.Fprintf
- fmt.Fprintln
godot:
# comments to be checked: `declarations`, `toplevel`, or `all`
scope: declarations
# check that each sentence starts with a capital letter
capital: true
exclusions:
rules:
# The govet `inline` analyzer reports stdlib calls that cannot be inlined
# into files using an older Go language version (go.mod is go 1.13).
# These are not actionable in user code; suppress them.
- linters:
- govet
text: "^inline: cannot inline call to"

linters-settings:
godot:
# comments to be checked: `declarations`, `toplevel`, or `all`
scope: declarations
# check that each sentence starts with a capital letter
capital: true

issues:
exclude-use-default: false
formatters:
enable:
- gofmt
2 changes: 1 addition & 1 deletion api/form_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ type apiClient struct {
postCount int
}

func (c *apiClient) PostForm(u string, params url.Values) (*http.Response, error) {
func (c *apiClient) PostForm(_ string, _ url.Values) (*http.Response, error) {
c.postCount++
return &http.Response{
Body: ioutil.NopCloser(bytes.NewBufferString(c.body)),
Expand Down
2 changes: 1 addition & 1 deletion device/device_flow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func TestPollToken(t *testing.T) {

singletonFakePoller := func(maxWaits int) pollerFactory {
var instance *fakePoller
return func(ctx context.Context, interval, expiresIn time.Duration) (context.Context, poller) {
return func(ctx context.Context, interval, _ time.Duration) (context.Context, poller) {
if instance != nil {
// This is to make the factory return the same instance in tests.
return ctx, instance
Expand Down
Loading