Skip to content

Commit f47e86e

Browse files
chore(dependencies): improve logging (#58)
1 parent 5b60d21 commit f47e86e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+232
-233
lines changed

.buildvars.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
go_version: "1.21"
2-
golangci_version: v1.55.2
3-
goreleaser_version: v1.16.2
1+
go_version: "1.24"
2+
golangci_version: v2.1.6
3+
goreleaser_version: v1.26.2
44

55
coverage_min: 80

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
cache: false
7171
- name: Run golangci-lint
7272
# https://github.com/marketplace/actions/run-golangci-lint
73-
uses: golangci/golangci-lint-action@v3
73+
uses: golangci/golangci-lint-action@v8
7474
with:
7575
version: ${{ needs.variables.outputs.golangci_version }}
7676
args: --timeout 10m

.github/workflows/coverage-badge.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
with:
4141
go-version: ${{ needs.variables.outputs.go_version }}
4242

43-
- uses: actions/cache@v2
43+
- uses: actions/cache@v4
4444
with:
4545
path: ~/go/pkg/mod
4646
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}

.golangci.yaml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
version: "2"
2+
run:
3+
tests: true
4+
output:
5+
formats:
6+
text:
7+
path: stdout
8+
print-linter-name: true
9+
print-issued-lines: true
10+
json:
11+
path: stderr
12+
checkstyle:
13+
path: go-report.xml
14+
linters:
15+
default: none
16+
enable:
17+
- depguard
18+
- dupl
19+
- errcheck
20+
- gochecknoinits
21+
# - gochecknoglobals
22+
- goconst
23+
- gocritic
24+
- gocyclo
25+
- govet
26+
- ineffassign
27+
- misspell
28+
- nolintlint
29+
- revive
30+
- staticcheck
31+
# disable:
32+
# - wsl
33+
# - nlreturn
34+
# - err113
35+
# - exhaustruct
36+
# - gochecknoglobals
37+
# - ireturn
38+
# - nonamedreturns
39+
# - varnamelen
40+
# - wrapcheck
41+
settings:
42+
depguard:
43+
rules:
44+
main:
45+
deny:
46+
- pkg: github.com/sirupsen/logrus
47+
desc: logging is allowed only by the local log package
48+
- pkg: logutils.Log
49+
desc: logging is allowed only by the local log package
50+
dupl:
51+
threshold: 100
52+
funlen:
53+
lines: 100
54+
statements: 50
55+
goconst:
56+
min-len: 2
57+
min-occurrences: 3
58+
gocritic:
59+
disabled-checks:
60+
- dupImport
61+
- ifElseChain
62+
- octalLiteral
63+
- whyNoLint
64+
enabled-tags:
65+
- diagnostic
66+
- experimental
67+
- opinionated
68+
- performance
69+
- style
70+
gocyclo:
71+
min-complexity: 15
72+
govet:
73+
settings:
74+
printf:
75+
funcs:
76+
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof
77+
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf
78+
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf
79+
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf
80+
lll:
81+
line-length: 120
82+
misspell:
83+
locale: US
84+
nolintlint:
85+
require-explanation: true
86+
require-specific: true
87+
allow-unused: false
88+
revive:
89+
rules:
90+
- name: unused-parameter
91+
disabled: true
92+
exclusions:
93+
generated: lax
94+
presets:
95+
- comments
96+
- common-false-positives
97+
- legacy
98+
- std-error-handling
99+
paths:
100+
- third_party$
101+
- builtin$
102+
- examples$
103+
formatters:
104+
enable:
105+
- gci
106+
- gofmt
107+
- gofumpt
108+
- goimports
109+
settings:
110+
gofumpt:
111+
module-path: github.tools.sap/AI/forest-workload-operator/components/workload-operator
112+
goimports:
113+
local-prefixes:
114+
- github.com/golangci/golangci-lint
115+
exclusions:
116+
generated: lax
117+
paths:
118+
- third_party$
119+
- builtin$
120+
- examples$

.golangci.yml

Lines changed: 0 additions & 125 deletions
This file was deleted.

.reuse/dep5

Lines changed: 0 additions & 29 deletions
This file was deleted.

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,15 @@ GOCACHE ?=$(HOME)/.cache/go-build
1818

1919
.PHONY: test
2020
test: ## Run unit tests in the code base outside of the tmp/ folder
21-
test_dir="$(shell go list ./... | grep -v -e tmp/)"; go test -v -race $$test_dir -coverprofile -covermode=count -coverprofile=coverage.out fmt
21+
test_dir="$(shell go list ./... | grep -v \
22+
-e tmp \
23+
-e pkg/log \
24+
-e pkg/testfuncs \
25+
-e pkg/version \
26+
-e pkg/terminal \
27+
-e pkg/github \
28+
-r commands \
29+
)"; go test -v -race $$test_dir -coverprofile -covermode=count -coverprofile=coverage.out fmt
2230
go tool cover -func=coverage.out -o=coverage.out
2331
cat coverage.out
2432

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Configuration tools for GitOps
22

3-
![Coverage](https://img.shields.io/badge/Coverage-84.8%25-brightgreen)
3+
![Coverage](https://img.shields.io/badge/Coverage-63.4%25-yellow)
44
[![REUSE status](https://api.reuse.software/badge/github.com/SAP/configuration-tools-for-gitops)](https://api.reuse.software/info/github.com/SAP/configuration-tools-for-gitops)
55

66
## About this project

REUSE.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version = 1
2+
SPDX-PackageName = "configuration-tools-for-gitops"
3+
SPDX-PackageSupplier = "jan.fokken@sap.com"
4+
SPDX-PackageDownloadLocation = "https://github.com/SAP/configuration-tools-for-gitops"
5+
SPDX-PackageComment = "The code in this project may include calls to APIs (\"API Calls\") of\n SAP or third-party products or services developed outside of this project\n (\"External Products\").\n \"APIs\" means application programming interfaces, as well as their respective\n specifications and implementing code that allows software to communicate with\n other software.\n API Calls to External Products are not licensed under the open source license\n that governs this project. The use of such API Calls and related External\n Products are subject to applicable additional agreements with the relevant\n provider of the External Products. In no event shall the open source license\n that governs this project grant any rights in or to any External Products,or\n alter, expand or supersede any terms of the applicable additional agreements.\n If you have a valid license agreement with SAP for the use of a particular SAP\n External Product, then you may make use of any API Calls included in this\n project's code for that SAP External Product, subject to the terms of such\n license agreement. If you do not have a valid license agreement for the use of\n a particular SAP External Product, then you may only make use of any API Calls\n in this project for that SAP External Product for your internal, non-productive\n and non-commercial test and evaluation of such API Calls. Nothing herein grants\n you any rights to use or access any SAP External Product, or provide any third\n parties the right to use of access any SAP External Product, through API Calls."
6+
7+
[[annotations]]
8+
path = "**"
9+
precedence = "aggregate"
10+
SPDX-FileCopyrightText = "2023 SAP SE or an SAP affiliate company and configuration-tools-for-gitops contributors"
11+
SPDX-License-Identifier = "Apache-2.0"

cmd/coco/commands/dependencies.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
)
1414

1515
const (
16-
allAllowed = 0777
16+
allAllowed = 0o777
1717
)
1818

1919
var (
@@ -24,7 +24,7 @@ var (
2424
)
2525

2626
func newDependencies() *cobra.Command {
27-
var c = &cobra.Command{
27+
c := &cobra.Command{
2828
Use: "dependencies",
2929
Aliases: []string{"deps"},
3030
Short: "Returns structured information which components and dependencies are affected by a change in git",

0 commit comments

Comments
 (0)