Skip to content

Commit

Permalink
enable linters
Browse files Browse the repository at this point in the history
  • Loading branch information
kuritka committed Sep 12, 2024
1 parent 4c472e5 commit abebfb3
Show file tree
Hide file tree
Showing 11 changed files with 100 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/golagci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ jobs:
- name: GolangCI
uses: golangci/golangci-lint-action@v3
with:
version: v1.55.2
args: --timeout=3m
version: v1.61.0
args: --timeout=3m -c .golangci.toml
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
!renovate.json

# ...even if they are in subdirectories
!*/
!*/
2 changes: 1 addition & 1 deletion .gitleaks.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ useDefault = true
description = "global allow list"
paths = [
'''README.md''','''.idea''','''.vscode'''
]
]
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", "ineffassign",
"goconst", "govet", "unparam", "gofmt"
]

[issues]
exclude-use-default = false
15 changes: 0 additions & 15 deletions .golic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,6 @@
# limitations under the License.
#
# Generated by GoLic, for more details see: https://github.com/AbsaOSS/golic
# Copyright 2022 The k8gb Contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated by GoLic, for more details see: https://github.com/AbsaOSS/golic
golic:
licenses:
apache2: |
Expand Down
2 changes: 1 addition & 1 deletion .licignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
!*.go
!Dockerfile*
!*.yaml
!.golic.yaml
!.golic.yaml
34 changes: 34 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
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:
- ".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
2 changes: 1 addition & 1 deletion release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@
"hidden": true
}
]
}
}
2 changes: 1 addition & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"extends": [
"config:recommended"
]
}
}
42 changes: 42 additions & 0 deletions taskfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright 2024 The external-dns-infoblox-webhook Contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated by GoLic, for more details see: https://github.com/AbsaOSS/golic
# 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
- golic inject -t apache2

lint-init:
cmds:
- brew install gitleaks
- brew install yamllint
# - brew install golangci-lint
# the program is in GO 1.23, whether you use `go install` or `brew install`,
# make sure that golangci-lint is >= v1.6.0
- go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0
- go install github.com/AbsaOSS/golic@v0.7.2

0 comments on commit abebfb3

Please sign in to comment.