github.com/pion/webrtc/v3@v3.2.24/.golangci.yml (about)

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