github.com/ydb-platform/ydb-go-sdk/v3@v3.89.2/.golangci.yml (about)

     1  # options for analysis running
     2  run:
     3    # exit code when at least one issue was found, default is 1
     4    issues-exit-code: 1
     5  
     6    # include test files or not, default is true
     7    tests: true
     8  
     9    # list of build tags, all linters use it. Default is empty list.
    10    #build-tags:
    11    #  - mytag
    12  
    13    # which files to skip: they will be analyzed, but issues from them
    14    # won't be reported. Default value is empty list, but there is
    15    # no need to include all autogenerated files, we confidently recognize
    16    # autogenerated files. If it's not please let us know.
    17    # skip-files:
    18    #    - ".*\\.my\\.go$"
    19    #    - lib/bad.go
    20  
    21  
    22  # output configuration options
    23  output:
    24    # colored-line-number|line-number|json|tab|checkstyle, default is "colored-line-number"
    25    formats: colored-line-number
    26  
    27    # print lines of code with issue, default is true
    28    print-issued-lines: true
    29  
    30    # print linter name in the end of issue text, default is true
    31    print-linter-name: true
    32  
    33  
    34  # all available settings of specific linters
    35  linters-settings:
    36    errcheck:
    37      # report about not checking of errors in types assetions: `a := b.(MyStruct)`;
    38      # default is false: such cases aren't reported by default.
    39      check-type-assertions: false
    40  
    41      # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
    42      # default is false: such cases aren't reported by default.
    43      check-blank: false
    44    govet:
    45      # report about shadowed variables
    46      shadow: true
    47    gofmt:
    48      # simplify code: gofmt with `-s` option, true by default
    49      simplify: true
    50    gofumpt:
    51      module-path: github.com/ydb-platform/ydb-go-sdk/v3
    52    goimports:
    53      # put imports beginning with prefix after 3rd-party packages;
    54      # it's a comma-separated list of prefixes
    55      local-prefixes: github.com/ydb-platform/ydb-go-sdk/v3
    56    gci:
    57      sections:
    58        - standard # Standard section: captures all standard packages.
    59        - default # Default section: contains all imports that could not be matched to another section type.
    60        - prefix(github.com/ydb-platform/ydb-go-sdk/v3) # Custom section: groups all imports with the specified Prefix.
    61      skip-generated: true
    62    goconst:
    63      # minimal length of string constant, 3 by default
    64      min-len: 2
    65      # minimal occurrences count to trigger, 3 by default
    66      min-occurrences: 2
    67      ignore-tests: true
    68    misspell:
    69      # Correct spellings using locale preferences for US or UK.
    70      # Default is to use a neutral variety of English.
    71      # Setting locale to US will correct the British spelling of 'colour' to 'color'.
    72      locale: US
    73      ignore-words:
    74        - cancelled
    75    revive:
    76      rules:
    77        - name: blank-imports
    78        - name: context-as-argument
    79        - name: context-keys-type
    80        - name: dot-imports
    81        - name: error-return
    82        - name: error-strings
    83        - name: error-naming
    84        - name: exported
    85        - name: if-return
    86        - name: increment-decrement
    87        - name: var-naming
    88        - name: var-declaration
    89        - name: package-comments
    90        - name: range
    91        - name: receiver-naming
    92        - name: time-naming
    93        - name: indent-error-flow
    94        - name: errorf
    95        - name: empty-block
    96        - name: superfluous-else
    97        - name: unreachable-code
    98    unparam:
    99      # Inspect exported functions, default is false. Set to true if no external program/library imports your code.
   100      # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors:
   101      # if it's called for subdir of a project it can't find external interfaces. All text editor integrations
   102      # with golangci-lint call it on a directory with the changed file.
   103      check-exported: false
   104    gomoddirectives:
   105      replace-local: true
   106      replace-allow-list:
   107        - xorm.io/xorm
   108    gocritic:
   109      disabled-checks:
   110        - whyNoLint # https://github.com/go-critic/go-critic/issues/1063
   111        - importShadow
   112        - sloppyReassign
   113      #      - typeDefFirst
   114      # Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks.
   115      # See https://github.com/go-critic/go-critic#usage -> section "Tags".
   116      # Default: []
   117      enabled-tags:
   118        - diagnostic
   119        - style
   120        - performance
   121        - experimental
   122        - opinionated
   123      # Settings passed to gocritic.
   124      # The settings key is the name of a supported gocritic checker.
   125      # The list of supported checkers can be find in https://go-critic.github.io/overview.
   126      settings:
   127        # Must be valid enabled check name.
   128        captLocal:
   129          # Whether to restrict checker to params only.
   130          # Default: true
   131          paramsOnly: false
   132        elseif:
   133          # Whether to skip balanced if-else pairs.
   134          # Default: true
   135          skipBalanced: false
   136        hugeParam:
   137          # Size in bytes that makes the warning trigger.
   138          # Default: 80
   139          sizeThreshold: 70
   140        nestingReduce:
   141          # Min number of statements inside a branch to trigger a warning.
   142          # Default: 5
   143          bodyWidth: 4
   144        rangeExprCopy:
   145          # Size in bytes that makes the warning trigger.
   146          # Default: 512
   147          sizeThreshold: 516
   148          # Whether to check test functions
   149          # Default: true
   150          skipTestFuncs: false
   151        rangeValCopy:
   152          # Size in bytes that makes the warning trigger.
   153          # Default: 128
   154          sizeThreshold: 32
   155          # Whether to check test functions.
   156          # Default: true
   157          skipTestFuncs: false
   158        ruleguard:
   159          # Enable debug to identify which 'Where' condition was rejected.
   160          # The value of the parameter is the name of a function in a ruleguard file.
   161          #
   162          # When a rule is evaluated:
   163          # If:
   164          #   The Match() clause is accepted; and
   165          #   One of the conditions in the Where() clause is rejected,
   166          # Then:
   167          #   ruleguard prints the specific Where() condition that was rejected.
   168          #
   169          # The flag is passed to the ruleguard 'debug-group' argument.
   170          # Default: ""
   171          debug: 'emptyDecl'
   172          # Deprecated, use 'failOn' param.
   173          # If set to true, identical to failOn='all', otherwise failOn=''
   174          failOnError: false
   175          # Determines the behavior when an error occurs while parsing ruleguard files.
   176          # If flag is not set, log error and skip rule files that contain an error.
   177          # If flag is set, the value must be a comma-separated list of error conditions.
   178          # - 'all':    fail on all errors.
   179          # - 'import': ruleguard rule imports a package that cannot be found.
   180          # - 'dsl':    gorule file does not comply with the ruleguard DSL.
   181          # Default: ""
   182          failOn: dsl
   183          # Comma-separated list of enabled groups or skip empty to enable everything.
   184          # Tags can be defined with # character prefix.
   185          # Default: "<all>"
   186          enable: "myGroupName,#myTagName"
   187          # Comma-separated list of disabled groups or skip empty to enable everything.
   188          # Tags can be defined with # character prefix.
   189          # Default: ""
   190          disable: "myGroupName,#myTagName"
   191        tooManyResultsChecker:
   192          # Maximum number of results.
   193          # Default: 5
   194          maxResults: 10
   195        truncateCmp:
   196          # Whether to skip int/uint/uintptr types.
   197          # Default: true
   198          skipArchDependent: false
   199        underef:
   200          # Whether to skip (*x).method() calls where x is a pointer receiver.
   201          # Default: true
   202          skipRecvDeref: false
   203        unnamedResult:
   204          # Whether to check exported functions.
   205          # Default: false
   206          checkExported: true
   207  linters:
   208    enable-all: true
   209    disable:
   210      - contextcheck
   211      - cyclop
   212      - depguard
   213      - dupl
   214      - err113
   215      - exhaustive
   216      - exhaustruct
   217      - fatcontext
   218      - forbidigo
   219      - gochecknoglobals
   220      - gocognit
   221      - gocritic
   222      - godot
   223      - gomnd
   224      - gosec
   225      - interfacebloat
   226      - intrange
   227      - ireturn
   228      - maintidx
   229      - mnd
   230      - nonamedreturns
   231      - paralleltest
   232      - perfsprint
   233      - predeclared
   234      - testableexamples
   235      - testifylint
   236      - testpackage
   237      - thelper
   238      - varnamelen
   239      - wrapcheck
   240      - wsl
   241  
   242  issues:
   243    # List of regexps of issue texts to exclude, empty list by default.
   244    # But independently from this option we use default exclude patterns,
   245    # it can be disabled by `exclude-use-default: false`. To list all
   246    # excluded by default patterns execute `golangci-lint run --help`
   247    # exclude:
   248  
   249    # List of regexps of issue texts to exclude.
   250    #
   251    # But independently of this option we use default exclude patterns,
   252    # it can be disabled by `exclude-use-default: false`.
   253    # To list all excluded by default patterns execute `golangci-lint run --help`
   254    #
   255    # Default: []
   256    exclude:
   257      - "has been deprecated since Go 1.16"
   258  
   259    # Independently from option `exclude` we use default exclude patterns,
   260    # it can be disabled by this option. To list all
   261    # excluded by default patterns execute `golangci-lint run --help`.
   262    # Default value for this option is true.
   263    exclude-use-default: true
   264  
   265    # Enables exclude of directories:
   266    # - vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
   267    # Default: true
   268    exclude-dirs-use-default: false
   269  
   270    # Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
   271    max-same-issues: 0
   272  
   273    # Show only new issues: if there are unstaged changes or untracked files,
   274    # only those changes are analyzed, else only changes in HEAD~ are analyzed.
   275    # It's a super-useful option for integration of golangci-lint into existing
   276    # large codebase. It's not practical to fix all existing issues at the moment
   277    # of integration: much better don't allow issues in new code.
   278    # Default is false.
   279    new: false
   280  
   281    # Show only new issues created after git revision `REV`
   282    # new-from-rev: REV
   283  
   284    # Show only new issues created in git patch with set file path.
   285    # new-from-patch: path/to/patch/file
   286    exclude-rules:
   287      - path: internal/xatomic/type.go
   288        linters:
   289          - predeclared
   290      - path: _test\.go
   291        linters:
   292          - scopelint
   293          - funlen
   294          - unused
   295          - unparam
   296          - gocritic
   297          - forcetypeassert
   298      - path: topic/topicreader/reader_example_test.go
   299        linters:
   300          - staticcheck
   301      - path: _test\.go
   302        text: "ydb.Connection is deprecated"
   303      - path: examples
   304        linters:
   305          - funlen
   306      - path: tests
   307        linters:
   308          - funlen
   309        # Allow underscore and capital camel case for readability
   310        # Examples: Type_PRIMITIVE_TYPE_ID_UNSPECIFIED, Ydb_Discovery_V1, _voidValue
   311      - linters:
   312          - nosnakecase
   313        text : "(?:_[a-z]+(?:[A-Z](?:[a-z\\d]+|[A-Z\\d]+))+|(?:[A-Z][a-z\\d]+|[A-Z][A-Z\\d]+)+_(?:(?:[A-Z][a-z\\d]+|[A-Z\\d][A-Z\\d]+)_?)+)"