Skip to content

Commit 2664b5a

Browse files
authored
[Maintenance] Add & Enable YAML Linter (#1251)
1 parent e4045c7 commit 2664b5a

File tree

67 files changed

+8991
-8833
lines changed

Some content is hidden

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

67 files changed

+8991
-8833
lines changed

.golangci.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
---
2-
31
run:
42
issues-exit-code: 3
53
timeout: 30m
@@ -8,21 +6,19 @@ run:
86
- .gobuild
97
- deps
108
- tools
11-
129
linters:
1310
disable-all: true
1411
enable:
15-
- gosimple
16-
- govet
17-
- ineffassign
12+
- gosimple
13+
- govet
14+
- ineffassign
1815
- staticcheck
19-
- typecheck
20-
- unconvert
21-
- unparam
16+
- typecheck
17+
- unconvert
18+
- unparam
2219
- unused
2320
- importas
2421
- gci
25-
2622
linters-settings:
2723
importas:
2824
no-unaliased: true

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- (Improvement) Reduce CI on Commit Travis runs
1212
- (Maintenance) Add license range rewrite command
1313
- (Feature) Optional Action
14+
- (Maintenance) Add & Enable YAML Linter
1415

1516
## [1.2.24](https://github.com/arangodb/kube-arangodb/tree/1.2.24) (2023-01-25)
1617
- (Bugfix) Fix deployment creation on ARM64

Makefile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,12 @@ EXCLUDE_DIRS := vendor .gobuild deps tools pkg/generated/clientset pkg/generated
198198
EXCLUDE_FILES := *generated.deepcopy.go
199199
SOURCES_QUERY := find ./ -type f -name '*.go' ! -name '*.pb.go' $(foreach EXCLUDE_DIR,$(EXCLUDE_DIRS), ! -path "*/$(EXCLUDE_DIR)/*") $(foreach EXCLUDE_FILE,$(EXCLUDE_FILES), ! -path "*/$(EXCLUDE_FILE)")
200200
SOURCES := $(shell $(SOURCES_QUERY))
201+
202+
YAML_EXCLUDE_DIRS := vendor .gobuild deps tools pkg/generated/clientset pkg/generated/informers pkg/generated/listers chart/kube-arangodb/templates chart/kube-arangodb-crd/templates chart/arangodb-ingress-proxy/templates
203+
YAML_EXCLUDE_FILES :=
204+
YAML_QUERY := find ./ -type f -name '*.yaml' $(foreach EXCLUDE_DIR,$(YAML_EXCLUDE_DIRS), ! -path "*/$(EXCLUDE_DIR)/*") $(foreach EXCLUDE_FILE,$(YAML_EXCLUDE_FILES), ! -path "*/$(EXCLUDE_FILE)")
205+
YAMLS := $(shell $(YAML_QUERY))
206+
201207
DASHBOARDSOURCES := $(shell find $(DASHBOARDDIR)/src -name '*.js') $(DASHBOARDDIR)/package.json
202208
LINT_EXCLUDES:=
203209
ifeq ($(RELEASE_MODE),enterprise)
@@ -242,6 +248,12 @@ fmt:
242248
@$(GOPATH)/bin/goimports -w $(SOURCES)
243249
@$(GOPATH)/bin/gci write -s "standard" -s "default" -s "prefix(github.com/arangodb)" -s "prefix(github.com/arangodb/kube-arangodb)" $(SOURCES)
244250

251+
.PHONY: yamlfmt
252+
yamlfmt:
253+
@echo ">> Ensuring style of yaml files"
254+
@$(GOPATH)/bin/yamlfmt -w $(YAMLS)
255+
@$(GOPATH)/bin/yamlfmt -w $(YAMLS)
256+
245257
.PHONY: license
246258
license:
247259
@echo ">> Ensuring license of files"
@@ -507,6 +519,8 @@ tools-min: update-vendor
507519
@GOBIN=$(GOPATH)/bin go install golang.org/x/tools/cmd/goimports@0bb7e5c47b1a31f85d4f173edc878a8e049764a5
508520
@echo ">> Fetching license check"
509521
@GOBIN=$(GOPATH)/bin go install github.com/google/addlicense@6d92264d717064f28b32464f0f9693a5b4ef0239
522+
@echo ">> Fetching yamlfmt"
523+
@GOBIN=$(GOPATH)/bin go install github.com/UltiRequiem/yamlfmt@v1.3.0
510524

511525
.PHONY: tools
512526
tools: tools-min
@@ -599,7 +613,7 @@ check-community:
599613
@$(MAKE) _check RELEASE_MODE=community
600614

601615
_check:
602-
@$(MAKE) fmt license-verify linter run-unit-tests bin
616+
@$(MAKE) fmt yamlfmt license-verify linter run-unit-tests bin
603617

604618
generate: generate-internal generate-proto fmt
605619

@@ -613,4 +627,4 @@ generate-proto:
613627
$(PROTOSOURCES)
614628

615629
.PHONY: fix
616-
fix: license-range fmt license
630+
fix: license-range fmt license yamlfmt
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
---
2-
31
replicas: 2
42
imagePullPolicy: Always
5-
image: nginx:1.16.1-alpine
3+
image: nginx:1.16.1-alpine

chart/kube-arangodb-crd/Chart.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
---
2-
31
name: kube-arangodb-crd
42
version: 1.2.24
5-
63
description: "ArangoDB Kubernetes Custom Resource Definitions"
74
tillerVersion: ">2.7"
8-
9-
appVersion: 3.5.0
5+
appVersion: 3.5.0

chart/kube-arangodb/Chart.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
---
2-
31
name: kube-arangodb
42
version: 1.2.24
5-
63
description: "ArangoDB Kubernetes Operator"
74
tillerVersion: ">2.7"
8-
9-
appVersion: 3.5.0
5+
appVersion: 3.5.0

chart/kube-arangodb/crds/member.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: apiextensions.k8s.io/v1
22
kind: CustomResourceDefinition
33
metadata:
4-
name: arangomembers.database.arangodb.com
4+
name: arangomembers.database.arangodb.com
55
spec:
66
group: database.arangodb.com
77
names:
@@ -30,4 +30,4 @@ spec:
3030
served: true
3131
storage: false
3232
subresources:
33-
status: {}
33+
status: {}

chart/kube-arangodb/values.yaml

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,46 @@
1-
---
2-
31
operator:
42
image: arangodb/kube-arangodb:1.2.24
53
imagePullPolicy: IfNotPresent
64
imagePullSecrets: []
7-
85
scope: legacy
9-
106
architectures:
11-
- amd64
12-
7+
- amd64
138
debug: false
14-
159
args: []
16-
1710
service:
1811
type: ClusterIP
19-
2012
annotations: {}
21-
2213
resources:
2314
limits:
2415
cpu: 1
2516
memory: 256Mi
2617
requests:
2718
cpu: 250m
2819
memory: 256Mi
29-
3020
securityContext:
3121
runAsUser: 1000
32-
3322
replicaCount: 2
34-
3523
updateStrategy:
3624
type: Recreate
37-
3825
allowChaos: false
39-
4026
nodeSelector: {}
41-
4227
enableCRDManagement: true
43-
4428
features:
4529
deployment: true
4630
deploymentReplications: true
4731
storage: false
4832
backup: false
4933
apps: false
5034
k8sToK8sClusterSync: false
51-
5235
images:
5336
base: alpine:3.11
5437
metricsExporter: arangodb/arangodb-exporter:0.1.7
5538
arango: arangodb/arangodb:latest
56-
5739
tolerations: []
58-
5940
rbac:
6041
enabled: true
6142
extensions:
6243
monitoring: true
6344
acs: true
6445
at: true
65-
debug: false
46+
debug: false

examples/arango-local-storage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ spec:
77
name: my-local-ssd
88
isDefault: true
99
localPath:
10-
- /var/lib/arango-storage
10+
- /var/lib/arango-storage

examples/arangojob.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ spec:
1010
containers:
1111
- name: pi
1212
image: perl
13-
command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
13+
command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
1414
restartPolicy: Never
15-
backoffLimit: 4
15+
backoffLimit: 4

0 commit comments

Comments
 (0)