generated from kyma-project/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- Thank you for your contribution. Before you submit the pull request: 1. Follow contributing guidelines, templates, the recommended Git workflow, and any related documentation. 2. Read and submit the required Contributor Licence Agreements (https://github.com/kyma-project/community/blob/main/CONTRIBUTING.md#agreements-and-licenses). 3. Test your changes and attach their results to the pull request. 4. Update the relevant documentation. If the pull request requires a decision, follow the [decision-making process](https://github.com/kyma-project/community/blob/main/governance.md) and replace the PR template with the [decision record template](https://github.com/kyma-project/community/blob/main/.github/ISSUE_TEMPLATE/decision-record.md). --> **Description** Changes proposed in this pull request: - Add and adapt linter config from lifecycle-manager - Fix linting issues **Related issue(s)** <!-- If you refer to a particular issue, provide its number. For example, `Resolves #123`, `Fixes #43`, or `See also #33`. --> --------- Co-authored-by: Badr, Nesma <nesma.badr@sap.com>
- Loading branch information
Showing
8 changed files
with
192 additions
and
67 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 |
---|---|---|
@@ -1,7 +1,103 @@ | ||
linters: | ||
enable-all: false | ||
run: | ||
timeout: 5m | ||
enable-all: true | ||
disable: | ||
- contextcheck # too many false positives | ||
- depguard # checks if package imports are whitelisted | ||
- exhaustruct # too subjective and harms code readability | ||
- exportloopref # deprecated (since v1.60.2), replaced by copyloopvar | ||
- gomnd # deprecated (since v1.58.0), renamed to mnd | ||
- lll | ||
- nlreturn # too strict and mostly code is not more readable | ||
- sqlclosecheck # not needed for this project | ||
- paralleltest # should be enabled consciously for long-running tests | ||
- wsl # too strict and mostly code is not more readable | ||
linters-settings: | ||
gomoddirectives: | ||
replace-local: true | ||
replace-allow-list: | ||
- github.com/kyma-project/template-operator/api | ||
stylecheck: | ||
dot-import-whitelist: | ||
- github.com/onsi/ginkgo/v2 | ||
- github.com/onsi/gomega | ||
revive: | ||
severity: error | ||
rules: | ||
- name: comment-spacings | ||
disabled: true | ||
- name: dot-imports | ||
severity: warning | ||
disabled: true | ||
- name: line-length-limit | ||
severity: warning | ||
disabled: true | ||
arguments: [ 120 ] | ||
funlen: | ||
lines: 80 | ||
cyclop: | ||
max-complexity: 20 | ||
nestif: | ||
min-complexity: 6 | ||
gci: | ||
sections: | ||
- standard # Standard packages. | ||
- default # Imports that could not be matched to another section type. | ||
- prefix(github.com/kyma-project/template-operator) # Imports with the specified prefix. | ||
- blank # Blank imports. | ||
- dot # Dot imports. | ||
custom-order: true | ||
skip-generated: true | ||
nolintlint: | ||
require-explanation: true | ||
ireturn: | ||
allow: | ||
- anon | ||
- error | ||
- empty | ||
- stdlib | ||
- Client | ||
- record.EventRecorder | ||
- client.Object | ||
- schema.ObjectKind #api/v1beta2/moduletemplate_types.go | ||
- runtime.Object #api/v1beta2/moduletemplate_types.go | ||
- meta.RESTMapper #internal/declarative/v2/client_proxy.go, internal/declarative/v2/rest_getter_proxy.go | ||
- client.SubResourceWriter #internal/declarative/v2/client_proxy.go | ||
- openapi.Resources #internal/declarative/v2/kube_factory_proxy.go | ||
- validation.Schema #internal/declarative/v2/kube_factory_proxy.go | ||
- discovery.CachedDiscoveryInterface #internal/declarative/v2/rest_getter_proxy.go | ||
- machineryruntime.Object #internal/declarative/v2/ssa.go | ||
- v1.Layer #internal/manifest/parse.go, tests/integration/controller/manifest/manifest.go | ||
- authn.Keychain #internal/manifest/spec_resolver.go, pkg/ocmextensions/cred.go | ||
- ratelimiter.RateLimiter #internal/rate_limiter.go | ||
varnamelen: | ||
ignore-names: | ||
- ok | ||
ignore-type-assert-ok: true | ||
ignore-map-index-ok: true | ||
ignore-chan-recv-ok: true | ||
exhaustruct: | ||
exclude: | ||
- gdfs | ||
issues: | ||
exclude-files: | ||
- zz_generated.deepcopy.go | ||
exclude-rules: | ||
- path: "_test\\.go" | ||
linters: | ||
- wrapcheck # Errors do not need to be wrapped in unit and integration tests | ||
- err113 # Dynamic error creation in unit and integration tests is ok | ||
- gochecknoglobals # Does not apply to unit and integration tests | ||
- funlen # Table driven unit and integration tests exceed function length by design | ||
- maintidx # Table driven unit and integration tests exceed maintainability index by design | ||
- linters: | ||
- lll | ||
source: "^// +kubebuilder: " # Exclude lll issues for long lines starting with kubebuilder marker prefix | ||
- linters: | ||
- lll # Exclude lll issues for long lines starting with an url | ||
source: "^// http " | ||
max-issues-per-linter: 0 | ||
max-same-issues: 0 | ||
output: | ||
sort-results: true | ||
run: | ||
timeout: 15m |
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
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.