Skip to content

Commit

Permalink
Merge pull request #17 from cjkreklow/housekeeping
Browse files Browse the repository at this point in the history
Update CI and dependency versions
  • Loading branch information
cjkreklow authored May 15, 2024
2 parents dc2fd58 + ab9444b commit f480675
Show file tree
Hide file tree
Showing 13 changed files with 78 additions and 53 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
name: GolangCI-Lint
steps:
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: '^1.19.0'
go-version: stable
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Run Lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: v1.49
version: latest
16 changes: 9 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '~1.19.0', '~1.18.0' ]
go: [ 'stable', 'oldstable' ]
name: Go ${{ matrix.go }}
steps:
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Run Tests
run: go test -v -race ./...
codecov:
Expand All @@ -26,14 +26,16 @@ jobs:
name: Codecov
steps:
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: '~1.19.0'
go-version: 'stable'
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Run Tests
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
- name: Upload to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
file: ./coverage.txt
token: ${{ secrets.CODECOV_TOKEN }}
49 changes: 35 additions & 14 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,61 +5,84 @@ linters:
- asciicheck # Check for non-ASCII identifiers
- bidichk # Checks for dangerous unicode character sequences
- bodyclose # Checks whether HTTP response body is closed successfully
- canonicalheader # Checks whether net/http.Header uses canonical header
- containedctx # Detects struct contained context.Context field
- contextcheck # Check if a function uses a non-inherited context
- cyclop # Checks function and package cyclomatic complexity
- decorder # Check declaration order and count of types, constants, variables and functions
- dogsled # Checks assignments with too many blank identifiers
- dupl # Code clone detection
- dupword # Checks for duplicate words in the source code
- durationcheck # Check for two durations multiplied together
- err113 # Check error handling expressions
- errcheck # Checking for unchecked errors
- errchkjson # Checks types passed to the json encoding functions. Reports unsupported types and optionally reports occasions where the check for the returned error can be omitted
- errchkjson # Checks types passed to the JSON encoding functions
- errname # Checks that sentinel errors are prefixed with `Err` and error types are suffixed with `Error`
- errorlint # Find code that will cause problems with error wrapping
- execinquery # query string checker
- exhaustive # Check exhaustiveness of enum switch statements
- exportloopref # Checks for pointers to enclosing loop variables
- fatcontext # Detects nested contexts in loops
- forbidigo # Forbids identifiers
- forcetypeassert # Finds forced type assertions
- funlen # Detection of long functions
- gci # Control package import order and make it always deterministic
- ginkgolinter # Enforces standards of using ginkgo and gomega
- gocheckcompilerdirectives # Checks that go compiler directive comments (//go:) are valid
- gochecknoglobals # Checks that no globals are present
- gochecknoinits # Checks that no init functions are present in Go code
- gochecksumtype # Run exhaustiveness checks on Go "sum types"
- gocognit # Computes and checks the cognitive complexity of functions
- goconst # Finds repeated strings that could be replaced by a constant
- gocritic # The most opinionated Go source code linter
- gocyclo # Computes and checks the cyclomatic complexity of functions
- godot # Check if comments end in a period
- godox # Detection of FIXME, TODO and other comment keywords
- goerr113 # Check error handling expressions
- gofmt # Checks whether code was gofmt-ed
- gofumpt # Checks whether code was gofumpt-ed
- goimports # Does everything that gofmt does and checks unused imports
- gomoddirectives # Manage the use of 'replace', 'retract', and 'excludes' in go.mod
- goprintffuncname # Checks that printf-like functions are named with `f` at the end
- gosec # Inspects source code for security problems
- gosimple # Specializes in simplifying code
- gosmopolitan # Report certain i18n/l10n anti-patterns in your Go codebase
- govet # Reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
- grouper # An analyzer to analyze expression groups
- importas # Enforces consistent import aliases
- inamedparam # Reports interfaces with unnamed method parameters
- ineffassign # Detects when assignments to existing variables are not used
- interfacebloat # Checks the number of methods inside an interface
- ireturn # Accept interfaces, return concrete types
- logrlint # Check logr arguments
- loggercheck # Checks key value pairs for common logger libraries
- maintidx # Measures the maintainability index of each function
- makezero # Finds slice declarations with non-zero initial length
- mirror # Reports wrong mirror patterns of bytes/strings usage
- misspell # Finds commonly misspelled English words in comments
- nakedret # Finds naked returns in functions greater than a specified function length
- nestif # Reports deeply nested if statements
- nilerr # Finds the code that returns nil even if it checks that the error is not nil
- nilnil # Checks that there is no simultaneous return of `nil` error and an invalid value
- nlreturn # Checks for a new line before return and branch statements
- noctx # Finds sending HTTP request without context.Context
- nolintlint # Reports ill-formed or insufficient nolint directives
- nosprintfhostport # Checks for misuse of Sprintf to construct a host with port in a URL
- perfsprint # Checks that fmt.Sprintf can be replaced with a faster alternative
- prealloc # Finds slice declarations that could potentially be preallocated
- predeclared # Find code that shadows one of Go's predeclared identifiers
- promlinter # Check Prometheus metrics naming via promlint
- protogetter # Reports direct reads from proto message fields when getters should be used
- reassign # Checks that package variables are not reassigned
- revive # Fast, configurable, extensible, flexible, and beautiful linter for Go
- rowserrcheck # Checks whether err of rows is checked successfully
- sloglint # Ensure consistent code style when using log/slog
- spancheck # Checks for mistakes with OpenTelemetry/Census spans
- sqlclosecheck # Checks that sql.Rows and sql.Stmt are closed
- staticcheck # Go vet on steroids, applying a ton of static analysis checks
- stylecheck # Replacement for golint
- tagalign # Checks that struct tags are well aligned
- tagliatelle # Checks the struct tags
- tenv # Detects using os.Setenv instead of t.Setenv
- testableexamples # Checks if examples are testable
- testifylint # Checks usage of github.com/stretchr/testify
- testpackage # Makes you use a separate _test package
- thelper # Detects test helpers without t.Helper() and checks the consistency of test helpers
- tparallel # Detects inappropriate usage of t.Parallel() method in Go test code
Expand All @@ -71,23 +94,21 @@ linters:
- wastedassign # Finds wasted assignment statements
- whitespace # Detection of leading and trailing whitespace
- wsl # Whitespace Linter - Forces you to use empty lines!
- zerologlint # Detects the wrong usage of `zerolog` that a user forgets to dispatch with `Send` or `Msg`

# Disabled until 1.22
#- copyloopvar # Detects places where loop variables are copied
#- intrange # Finds places where for loops could make use of an integer range

#- depguard # Checks if package imports are in a list of acceptable packages
#- exhaustruct # Checks if all structure fields are initialized
#- gci # Control package import order and make it always deterministic
#- gofumpt # Checks whether code was gofumpt-ed
#- goheader # Checks if file header matches to pattern
#- goimports # Does everything that gofmt does and checks unused imports
#- gomnd # An analyzer to detect magic numbers
#- gomodguard # Allow and block list linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations.
#- gomodguard # Allow and block list linter for direct Go module dependencies
#- lll # Reports long lines
#- noctx # Finds sending HTTP request without context.Context
#- mnd # An analyzer to detect magic numbers
#- musttag # Enforce field tags in (un)marshaled structs
#- nonamedreturns # Reports all named returns
#- paralleltest # Detects missing usage of t.Parallel() method in tests
#- promlinter # Check Prometheus metrics naming via promlint
#- rowserrcheck # Checks whether err of rows is checked successfully
#- sqlclosecheck # Checks that sql.Rows and sql.Stmt are closed.
#- stylecheck # Replacement for golint
#- varnamelen # Checks that the length of a variable's name matches its scope
#- wrapcheck # Checks that errors returned from external packages are wrapped

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright 2020 Collin Kreklow
Copyright 2024 Collin Kreklow

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
Expand Down
2 changes: 1 addition & 1 deletion cli.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Collin Kreklow
// Copyright 2024 Collin Kreklow
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
Expand Down
2 changes: 1 addition & 1 deletion cmd.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Collin Kreklow
// Copyright 2024 Collin Kreklow
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
Expand Down
2 changes: 1 addition & 1 deletion cmd_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Collin Kreklow
// Copyright 2024 Collin Kreklow
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
Expand Down
2 changes: 1 addition & 1 deletion exit.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Collin Kreklow
// Copyright 2024 Collin Kreklow
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
Expand Down
2 changes: 1 addition & 1 deletion exit_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Collin Kreklow
// Copyright 2024 Collin Kreklow
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
Expand Down
14 changes: 8 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
module kreklow.us/go/cli

go 1.13
go 1.21

require (
github.com/Netflix/go-expect v0.0.0-20200312175327-da48e75238e2
github.com/creack/pty v1.1.11 // indirect
github.com/kr/pty v1.1.8 // indirect
github.com/mattn/go-isatty v0.0.16
github.com/stretchr/testify v1.3.0 // indirect
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2
github.com/mattn/go-isatty v0.0.20
)

require (
github.com/creack/pty v1.1.17 // indirect
golang.org/x/sys v0.6.0 // indirect
)
26 changes: 13 additions & 13 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
github.com/Netflix/go-expect v0.0.0-20200312175327-da48e75238e2 h1:y2avNRjCeJT8b7svzjhKZjsvW5Jki/iAqTBEPJURaUg=
github.com/Netflix/go-expect v0.0.0-20200312175327-da48e75238e2/go.mod h1:oX5x61PbNXchhh0oikYAH+4Pcfw5LKv21+Jnpr6r6Pc=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw=
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63nhn5WAunQHLTznkw5W8b1Xc0dNjp83s=
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w=
github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI=
github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/kr/pty v1.1.8 h1:AkaSdXYQOWeaO3neb8EM634ahkXXe3jYbVh/F9lq+GI=
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab h1:2QkjZIsXupsJbJIdSjjUOgWK3aEtzyuh2mPt3l/CkeU=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
2 changes: 1 addition & 1 deletion write.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Collin Kreklow
// Copyright 2024 Collin Kreklow
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
Expand Down
2 changes: 1 addition & 1 deletion write_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Collin Kreklow
// Copyright 2024 Collin Kreklow
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
Expand Down

0 comments on commit f480675

Please sign in to comment.