corso/src/.golangci.yml
Danny 3a5211590a
GC: Beta Client Package (#2205)
## Description
To add needed features, Kiota-Generated Beta Connector created
<!-- Insert PR description-->

## Does this PR need a docs update or release note?

- [x]  Yes, it's included


## Type of change

<!--- Please check the type of change your PR introduces: --->
- [x] 🌻 Feature

## Issue(s)

<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->
* closes  #2086<issue>
* closes #2174 
* closes #2223

## Test Plan
Compilation and current CI tests will fail if the package does not align with current operational standards. 
- [x]  Unit test
- [x] 💚 E2E
2023-01-31 16:38:28 +00:00

119 lines
3.4 KiB
YAML

run:
timeout: 20m
linters:
enable:
- gofmt
- gofumpt
- errcheck
- forbidigo
- lll
- misspell
- revive
- wsl
disable:
# Consumes a large amount of memory when running with Graph SDK in the
# project causing OOM failures in Github actions.
- staticcheck
linters-settings:
gci:
sections:
- standard
- default
- prefix(github.com/alcionai/corso)
skip-generated: true
forbidigo:
forbid:
# Don't allow creating contexts without logging in tests. Use an ignore
# lower down to ensure usages of this outside of tests aren't reported.
- 'context\.(Background|TODO)(# tests should use tester\.NewContext )?'
# Don't allow use of path as it hardcodes separator to `/`.
# Use filepath instead.
- '\bpath\.(Ext|Base|Dir|Join)'
# Don't allow the typo m356 to be used in place of m365.
- '[Mm]356'
lll:
line-length: 120
revive:
max-open-files: 2048
# Don't know why, but false means ignore generated files.
ignore-generated-header: false
rules:
- name: blank-imports
- name: bool-literal-in-expr
- name: constant-logical-expr
- name: context-as-argument
- name: context-keys-type
- name: duplicated-imports
- name: early-return
- name: empty-block
- name: errorf
- name: error-naming
- name: error-return
- name: error-strings
- name: exported
- name: identical-branches
- name: if-return
- name: import-shadowing
- name: increment-decrement
- name: indent-error-flow
- name: modifies-value-receiver
- name: package-comments
- name: range
- name: receiver-naming
- name: redefines-builtin-id
- name: superfluous-else
- name: time-equal
- name: time-naming
- name: unreachable-code
- name: useless-break
- name: var-declaration
- name: var-naming
issues:
# Limit on number of errors with identical text reported.
max-same-issues: 50
exclude-rules:
- linters:
- revive
text: "exported:.*details.DetailsModel by other packages, and that stutters"
- linters:
- revive
text: "exported:.*details.DetailsEntry by other packages, and that stutters"
- linters:
- revive
text: "exported:.*mock.MockModelStore by other packages, and that stutters"
- linters:
- revive
text: "unexported-return:.*unexported type selectors.exchangeCategory"
- linters:
- revive
text: "unexported-return:.*unexported type.*kopia.conn"
- path: _test\.go
linters:
- revive
text: "import-shadowing:.*'suite' shadows"
# Don't output about context.Background or context.TODO in non-test files.
# Need complicated multi-part regex because golang doesn't support not regex
# operators for sequences of characters (only character sets). The below
# basically boils down to:
# 1. anything 4 characters long with .go suffix
# 2. anything >= 5 characters long that doesn't end in _test.go
- path: ^.{4}\.go|.*([^_].{4}|_[^t].{3}|_t[^e].{2}|_te[^s].{1}|_tes[^t])\.go
linters:
- forbidigo
text: "context.(Background|TODO)"
- path: internal/connector/graph/betasdk
linters:
- wsl
- revive
- gci
- lll
- gofmt
- gofumpt
- misspell
- errcheck