-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* suggestions * makefile, lint * webrpc v0.21.0 * github action go version from go.mod file * non exporting Config.get method * lint in CI * invalid tests cases * test case for session admin without account * lint imports * pr comments
- Loading branch information
1 parent
5ce6340
commit 989c1fc
Showing
17 changed files
with
770 additions
and
645 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
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 @@ | ||
coverage.out |
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,88 @@ | ||
linters: | ||
# Disable all linters. | ||
disable-all: true | ||
# Enable specific linter | ||
enable: | ||
- errcheck | ||
- gci | ||
- wrapcheck | ||
- ineffassign | ||
- unused | ||
|
||
run: | ||
# Number of operating system threads (`GOMAXPROCS`) that can execute golangci-lint simultaneously. | ||
# If it is explicitly set to 0 (i.e. not the default) then golangci-lint will automatically set the value to match Linux container CPU quota. | ||
# Default: the number of logical CPUs in the machine | ||
concurrency: 8 | ||
# Timeout for analysis, e.g. 30s, 5m. | ||
# Default: 1m | ||
timeout: 5m | ||
go: '1.22.0' | ||
|
||
output: | ||
# Show statistics per linter. | ||
show-stats: true | ||
# Sort results by the order defined in `sort-order`. | ||
sort-results: true | ||
# Order to use when sorting results. | ||
# Require `sort-results` to `true`. | ||
# Possible values: `file`, `linter`, and `severity`. | ||
# | ||
# If the severity values are inside the following list, they are ordered in this order: | ||
# 1. error | ||
# 2. warning | ||
# 3. high | ||
# 4. medium | ||
# 5. low | ||
# Either they are sorted alphabetically. | ||
sort-order: | ||
- linter | ||
- file | ||
- severity | ||
|
||
issues: | ||
# Maximum issues count per one linter. | ||
# Set to 0 to disable. | ||
# Default: 50 | ||
max-issues-per-linter: 0 | ||
# Maximum count of issues with the same text. | ||
# Set to 0 to disable. | ||
# Default: 3 | ||
max-same-issues: 0 | ||
exclude-rules: | ||
- linters: | ||
- lll | ||
source: "^//go:generate " | ||
exclude-dirs: | ||
- "tools" | ||
exclude-files: | ||
- ".*\\.gen\\.go$" | ||
- ".*\\.ridl$" | ||
|
||
linters-settings: | ||
errcheck: | ||
# List of functions to exclude from checking, where each entry is a single function to exclude. | ||
# See https://github.com/kisielk/errcheck#excluding-functions for details. | ||
exclude-functions: | ||
- (net/http.ResponseWriter).Write | ||
|
||
gci: | ||
# Section configuration to compare against. | ||
# Section names are case-insensitive and may contain parameters in (). | ||
# The default order of sections is `standard > default > custom > blank > dot > alias > localmodule`, | ||
# If `custom-order` is `true`, it follows the order of `sections` option. | ||
# Default: ["standard", "default"] | ||
sections: | ||
- standard # Standard section: captures all standard packages. | ||
- default # Default section: contains all imports that could not be matched to another section type. | ||
- prefix(github.com/0xsequence/authcontrol) # Custom section: groups all imports with the specified Prefix. | ||
# Skip generated files. | ||
# Default: true | ||
skip-generated: true | ||
# Enable custom order of sections. | ||
# If `true`, make the section order the same as the order of `sections`. | ||
# Default: false | ||
custom-order: true | ||
# Drops lexical ordering for custom sections. | ||
# Default: false | ||
no-lex-order: false |
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,29 @@ | ||
TEST_FLAGS ?= -p 8 -failfast -race -shuffle on | ||
|
||
all: | ||
@echo "make <cmd>:" | ||
@echo "" | ||
@echo "commands:" | ||
@awk -F'[ :]' '/^#+/ {comment=$$0; gsub(/^#+[ ]*/, "", comment)} !/^(_|all:)/ && /^([A-Za-z_-]+):/ && !seen[$$1]++ {printf " %-24s %s\n", $$1, (comment ? "- " comment : ""); comment=""} !/^#+/ {comment=""}' Makefile | ||
|
||
test-clean: | ||
go clean -testcache | ||
|
||
test: test-clean | ||
go test -run=$(TEST) $(TEST_FLAGS) -json ./... | tparse --all --follow | ||
|
||
test-rerun: test-clean | ||
go run github.com/goware/rerun/cmd/rerun -watch ./ -run 'make test' | ||
|
||
test-coverage: | ||
go test -run=$(TEST) $(TEST_FLAGS) -cover -coverprofile=coverage.out -json ./... | tparse --all --follow | ||
|
||
test-coverage-inspect: test-coverage | ||
go tool cover -html=coverage.out | ||
|
||
generate: | ||
go generate -x ./... | ||
|
||
lint: | ||
golangci-lint run ./... --fix -c .golangci.yml | ||
|
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
Oops, something went wrong.