github.com/pion/webrtc/v4@v4.0.1/.golangci.yml (about) 1 # SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly> 2 # SPDX-License-Identifier: MIT 3 4 run: 5 timeout: 5m 6 7 linters-settings: 8 govet: 9 enable: 10 - shadow 11 misspell: 12 locale: US 13 exhaustive: 14 default-signifies-exhaustive: true 15 gomodguard: 16 blocked: 17 modules: 18 - github.com/pkg/errors: 19 recommendations: 20 - errors 21 forbidigo: 22 forbid: 23 - ^fmt.Print(f|ln)?$ 24 - ^log.(Panic|Fatal|Print)(f|ln)?$ 25 - ^os.Exit$ 26 - ^panic$ 27 - ^print(ln)?$ 28 29 linters: 30 enable: 31 - asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers 32 - bidichk # Checks for dangerous unicode character sequences 33 - bodyclose # checks whether HTTP response body is closed successfully 34 - contextcheck # check the function whether use a non-inherited context 35 - decorder # check declaration order and count of types, constants, variables and functions 36 - dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) 37 - dupl # Tool for code clone detection 38 - durationcheck # check for two durations multiplied together 39 - errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases 40 - errchkjson # Checks types passed to the json encoding functions. Reports unsupported types and optionally reports occations, where the check for the returned error can be omitted. 41 - errname # Checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`. 42 - errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13. 43 - exhaustive # check exhaustiveness of enum switch statements 44 - exportloopref # checks for pointers to enclosing loop variables 45 - forbidigo # Forbids identifiers 46 - forcetypeassert # finds forced type assertions 47 - gci # Gci control golang package import order and make it always deterministic. 48 - gochecknoglobals # Checks that no globals are present in Go code 49 - gochecknoinits # Checks that no init functions are present in Go code 50 - gocognit # Computes and checks the cognitive complexity of functions 51 - goconst # Finds repeated strings that could be replaced by a constant 52 - gocritic # The most opinionated Go source code linter 53 - godox # Tool for detection of FIXME, TODO and other comment keywords 54 - err113 # Golang linter to check the errors handling expressions 55 - gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification 56 - gofumpt # Gofumpt checks whether code was gofumpt-ed. 57 - goheader # Checks is file header matches to pattern 58 - goimports # Goimports does everything that gofmt does. Additionally it checks unused imports 59 - gomoddirectives # Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod. 60 - 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. 61 - goprintffuncname # Checks that printf-like functions are named with `f` at the end 62 - gosec # Inspects source code for security problems 63 - gosimple # Linter for Go source code that specializes in simplifying a code 64 - govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string 65 - grouper # An analyzer to analyze expression groups. 66 - importas # Enforces consistent import aliases 67 - ineffassign # Detects when assignments to existing variables are not used 68 - misspell # Finds commonly misspelled English words in comments 69 - nilerr # Finds the code that returns nil even if it checks that the error is not nil. 70 - nilnil # Checks that there is no simultaneous return of `nil` error and an invalid value. 71 - noctx # noctx finds sending http request without context.Context 72 - predeclared # find code that shadows one of Go's predeclared identifiers 73 - revive # golint replacement, finds style mistakes 74 - staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks 75 - stylecheck # Stylecheck is a replacement for golint 76 - tagliatelle # Checks the struct tags. 77 - tenv # tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17 78 - tparallel # tparallel detects inappropriate usage of t.Parallel() method in your Go test codes 79 - typecheck # Like the front-end of a Go compiler, parses and type-checks Go code 80 - unconvert # Remove unnecessary type conversions 81 - unparam # Reports unused function parameters 82 - unused # Checks Go code for unused constants, variables, functions and types 83 - wastedassign # wastedassign finds wasted assignment statements 84 - whitespace # Tool for detection of leading and trailing whitespace 85 disable: 86 - depguard # Go linter that checks if package imports are in a list of acceptable packages 87 - containedctx # containedctx is a linter that detects struct contained context.Context field 88 - cyclop # checks function and package cyclomatic complexity 89 - funlen # Tool for detection of long functions 90 - gocyclo # Computes and checks the cyclomatic complexity of functions 91 - godot # Check if comments end in a period 92 - gomnd # An analyzer to detect magic numbers. 93 - ireturn # Accept Interfaces, Return Concrete Types 94 - lll # Reports long lines 95 - maintidx # maintidx measures the maintainability index of each function. 96 - makezero # Finds slice declarations with non-zero initial length 97 - nakedret # Finds naked returns in functions greater than a specified function length 98 - nestif # Reports deeply nested if statements 99 - nlreturn # nlreturn checks for a new line before return and branch statements to increase code clarity 100 - nolintlint # Reports ill-formed or insufficient nolint directives 101 - paralleltest # paralleltest detects missing usage of t.Parallel() method in your Go test 102 - prealloc # Finds slice declarations that could potentially be preallocated 103 - promlinter # Check Prometheus metrics naming via promlint 104 - rowserrcheck # checks whether Err of rows is checked successfully 105 - sqlclosecheck # Checks that sql.Rows and sql.Stmt are closed. 106 - testpackage # linter that makes you use a separate _test package 107 - thelper # thelper detects golang test helpers without t.Helper() call and checks the consistency of test helpers 108 - varnamelen # checks that the length of a variable's name matches its scope 109 - wrapcheck # Checks that errors returned from external packages are wrapped 110 - wsl # Whitespace Linter - Forces you to use empty lines! 111 112 issues: 113 exclude-use-default: false 114 exclude-dirs-use-default: false 115 exclude-rules: 116 # Allow complex tests and examples, better to be self contained 117 - path: (examples|main\.go|_test\.go) 118 linters: 119 - forbidigo 120 - gocognit 121 122 # Allow forbidden identifiers in CLI commands 123 - path: cmd 124 linters: 125 - forbidigo