-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
235 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
go.sum linguist-generated | ||
* text=auto eol=lf | ||
*.ps1 text eol=crlf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: golangci-lint | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
GOLANGCI_LINT_VERSION: v1.61 | ||
CGO_ENABLED: 0 | ||
|
||
jobs: | ||
golangci: | ||
strategy: | ||
matrix: | ||
go: [stable] | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
name: lint | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
|
||
- name: Check and get dependencies | ||
run: | | ||
go mod download | ||
go mod tidy | ||
git diff --exit-code go.mod | ||
git diff --exit-code go.sum | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v6 | ||
with: | ||
version: ${{ env.GOLANGCI_LINT_VERSION }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Tests | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
CGO_ENABLED: 0 | ||
|
||
jobs: | ||
cross: | ||
name: Go | ||
strategy: | ||
matrix: | ||
go-version: [ oldstable, stable ] | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Test | ||
run: make test | ||
|
||
- name: Build | ||
run: make build | ||
|
||
- name: Vet integration | ||
run: make vet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.idea/ | ||
/go-printf-func-name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
linters: | ||
disable-all: true | ||
enable: | ||
- asasalint | ||
- asciicheck | ||
- bidichk | ||
- containedctx | ||
- contextcheck | ||
# - copyloopvar | ||
- cyclop | ||
- dogsled | ||
- dupl | ||
- dupword | ||
- durationcheck | ||
- err113 | ||
- errcheck | ||
- errname | ||
- errorlint | ||
- fatcontext | ||
- forbidigo | ||
- funlen | ||
- gci | ||
- gocheckcompilerdirectives | ||
- gochecknoglobals | ||
- gochecknoinits | ||
- gocognit | ||
- goconst | ||
- gocritic | ||
- gocyclo | ||
- godot | ||
- godox | ||
- gofmt | ||
- gofumpt | ||
- goimports | ||
- gomoddirectives | ||
- gomodguard | ||
- goprintffuncname | ||
- gosec | ||
- gosimple | ||
- govet | ||
- importas | ||
- inamedparam | ||
- ineffassign | ||
- interfacebloat | ||
# - intrange | ||
- ireturn | ||
- loggercheck | ||
- maintidx | ||
- makezero | ||
- mirror | ||
- misspell | ||
- musttag | ||
- nestif | ||
- nilerr | ||
- nlreturn | ||
- noctx | ||
- nolintlint | ||
- nonamedreturns | ||
- perfsprint | ||
- predeclared | ||
- reassign | ||
- revive | ||
- staticcheck | ||
- stylecheck | ||
- tagalign | ||
- tagliatelle | ||
- tenv | ||
- testableexamples | ||
- testifylint | ||
- thelper | ||
- tparallel | ||
- unconvert | ||
- unparam | ||
- unused | ||
- usestdlibvars | ||
- wastedassign | ||
- whitespace | ||
- wrapcheck | ||
- wsl | ||
|
||
linters-settings: | ||
stylecheck: | ||
checks: ['*', '-ST1000'] | ||
cyclop: | ||
max-complexity: 15 | ||
|
||
issues: | ||
exclude-use-default: false | ||
max-issues-per-linter: 0 | ||
max-same-issues: 0 | ||
exclude-rules: | ||
- linters: | ||
- revive | ||
text: "package-comments: should have a package comment" | ||
- linters: | ||
- revive | ||
text: "exported: .+ should have comment or be unexported" | ||
- path: pkg/analyzer/analyzer.go | ||
linters: | ||
- gochecknoglobals | ||
text: "Analyzer is a global variable" | ||
|
||
output: | ||
show-stats: true | ||
sort-results: true | ||
sort-order: | ||
- linter | ||
- file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.PHONY: lint test build vet | ||
|
||
default: lint test vet | ||
|
||
test: | ||
go test -v -cover ./... | ||
|
||
lint: | ||
golangci-lint run | ||
|
||
build: | ||
go build ./cmd/go-printf-func-name/ | ||
|
||
vet: build | ||
go vet -vettool=./go-printf-func-name ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
module github.com/jirfag/go-printf-func-name | ||
module github.com/golangci/go-printf-func-name | ||
|
||
go 1.13 | ||
go 1.22.0 | ||
|
||
require golang.org/x/tools v0.0.0-20191108193012-7d206e10da11 | ||
require golang.org/x/tools v0.26.0 | ||
|
||
require ( | ||
golang.org/x/mod v0.21.0 // indirect | ||
golang.org/x/sync v0.8.0 // indirect | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters