Skip to content

Commit

Permalink
linters
Browse files Browse the repository at this point in the history
  • Loading branch information
kuritka committed Sep 11, 2024
1 parent 4c472e5 commit d8bd2af
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .golangci.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[run]
timeout = "120s"

[output]
formats = "colored-line-number"

[linters]
enable = [
"gocyclo", "unconvert", "goimports", "unused",
"misspell", "nakedret", "errcheck", "revive", "ineffassign",
"goconst", "govet", "unparam", "gofmt"
]

[issues]
exclude-use-default = false
35 changes: 35 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
yaml-files:
- '*.yaml'
- '.yamllint'

rules:
braces:
level: warning
max-spaces-inside: 1
brackets: enable
colons: enable
commas: enable
comments:
level: warning
comments-indentation:
level: warning
document-end: disable
document-start: disable
empty-lines: enable
empty-values: disable
hyphens: enable
indentation: disable
key-duplicates: enable
key-ordering: disable
line-length: disable
new-line-at-end-of-file: enable
new-lines: enable
octal-values: disable
quoted-strings: disable
trailing-spaces: enable
truthy: disable

ignore:
- "**/templates/*.yaml"
- "**/.golic.yaml"
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ Generated by GoLic, for more details see: https://github.com/AbsaOSS/golic
*/

import (
epclient "github.com/absaoss/cap-infra-dns/pkg/client"
"os"

epclient "github.com/absaoss/cap-infra-dns/pkg/client"

"github.com/absaoss/cap-infra-dns/pkg/controller"
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
Expand Down
22 changes: 22 additions & 0 deletions taskfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# https://taskfile.dev/usage/
---
version: '3'

env:
TFENV_TERRAFORM_VERSION: 1.5.7

dotenv: ['.env']

tasks:
lint:
cmds:
- gitleaks detect . --no-git --verbose --config=.gitleaks.toml
- yamllint .
- goimports -w ./
- golangci-lint run

lint-init:
cmds:
- brew install gitleaks
- brew install yamllint
- brew install golangci-lint

0 comments on commit d8bd2af

Please sign in to comment.