Skip to content

Commit e2dee37

Browse files
authored
[ALL] Add a pre-commit default configuration (#25)
2 parents 5587aa2 + abeeeb9 commit e2dee37

20 files changed

Lines changed: 159 additions & 117 deletions

.pre-commit-config.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
repos:
2+
- repo: https://github.com/Gaspi/pre-commit-hooks
3+
rev: v0.3
4+
hooks:
5+
# Validate schemas using the jsonschema.validators package
6+
- id: validate-json-schemas
7+
args:
8+
# Forbid legacy https://json-schema.org/draft/2020-12/schema schema validator and suggest Draft 7 instead
9+
- --forbid-legacy
10+
# Ensure technically facultative attribute (such as `type`) are systematically specified
11+
- id: missing-attributes-schemas
12+
args:
13+
# Also require `items` to be systematically specified for arrays
14+
- --check-items
15+
# Also require `properties` to be systematically specified for object
16+
- --check-properties
17+
# Also require `properties` to be systematically specified for object
18+
- --check-defaults
19+
- id: version-bump
20+
args:
21+
- --branch
22+
- main
23+
24+
- repo: https://github.com/pre-commit/pre-commit-hooks
25+
rev: v5.0.0
26+
hooks:
27+
# Check yaml files except for Helm templates
28+
- id: check-yaml
29+
exclude: "/(templates|tests)/"
30+
# Check empty new line before EOF (ignore generated charts)
31+
- id: end-of-file-fixer
32+
# Check trailing whitespaces (ignore generated charts)
33+
- id: trailing-whitespace
34+
35+
# Run `helm lint` on all (modified) charts: this may require a manual `helm dep update`:
36+
# ls charts | xargs -i{} bash -c "cd charts/{} && helm dep update"
37+
- repo: https://github.com/gruntwork-io/pre-commit
38+
rev: v0.1.15
39+
hooks:
40+
- id: helmlint

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
This collection of Helm Charts is tailored for datascientists !
44
It is primarly designed to work with [Onyxia](https://github.com/inseefrlab/onyxia)
5-
See the other repository ([Helm charts](https://github.com/inseefrlab/helm-charts-interactive-services)) for interactive focused charts.
5+
See the other repository ([Helm charts](https://github.com/inseefrlab/helm-charts-interactive-services)) for interactive focused charts.
66

77
To use the repo on helm (version 3+) :
88
```
99
helm repo add inseefrlab-datascience https://inseefrlab.github.io/helm-charts-datavisualization
10-
```
10+
```
1111

1212
The repo is also browsable directly https://inseefrlab.github.io/helm-charts-datavisualization/index.yaml
1313

charts/metabase/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type: application
2222
# This is the chart version. This version number should be incremented each time you make changes
2323
# to the chart and its templates, including the app version.
2424
# Versions are expected to follow Semantic Versioning (https://semver.org/)
25-
version: 2.0.1
25+
version: 2.0.2
2626

2727
# This is the version number of the application being deployed. This version number should be
2828
# incremented each time you make changes to the application. Versions are not expected to

charts/metabase/templates/NOTES.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
{{- if .Values.route.enabled }}
55
- You can connect to Metabase with your browser on this [link](https://{{ .Values.route.hostname }})
66
{{- end }}
7-
- After the first launch, you will need to set your login credentials.
8-
- If you start a new {{ .Chart.Name }}, the same settings will be reused silently.
7+
- After the first launch, you will need to set your login credentials.
8+
- If you start a new {{ .Chart.Name }}, the same settings will be reused silently.
99

1010
*NOTES about deletion :*
1111

charts/metabase/templates/deployment.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ spec:
7676
until printf "." && nc -z -w 2 {{ .Values.postgresql.fullnameOverride }} 5432; do
7777
sleep 2;
7878
done;
79-
echo 'PostgreSQL OK ✓'
80-
81-
{{- with .Values.nodeSelector }}
79+
echo 'PostgreSQL OK ✓'
80+
81+
{{- with .Values.nodeSelector }}
8282
nodeSelector:
8383
{{- toYaml . | nindent 8 }}
8484
{{- end }}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{{ include "library-chart.ingress" . }}
1+
{{ include "library-chart.ingress" . }}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{{ include "library-chart.networkPolicyIngress" . }}
1+
{{ include "library-chart.networkPolicyIngress" . }}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{{ include "library-chart.networkPolicy" . }}
1+
{{ include "library-chart.networkPolicy" . }}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{{ include "library-chart.serviceAccount" . }}
1+
{{ include "library-chart.serviceAccount" . }}

charts/metabase/values.schema.json

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "http://json-schema.org/schema#",
2+
"$schema": "http://json-schema.org/draft-07/schema#",
33
"type": "object",
44
"properties": {
55
"resources": {
@@ -95,27 +95,31 @@
9595
"type": "object",
9696
"description": "Define access policy to the service",
9797
"x-onyxia": {
98-
"overwriteSchemaWith": "network-policy.json"
98+
"overwriteSchemaWith": "network-policy.json"
9999
},
100100
"properties": {
101-
"enabled": {
102-
"type": "boolean",
103-
"title": "Enable network policy",
104-
"description": "Only pod from the same namespace will be allowed",
105-
"default": false,
106-
"x-onyxia": {
107-
"overwriteDefaultWith": "region.defaultNetworkPolicy"
108-
}
101+
"enabled": {
102+
"type": "boolean",
103+
"title": "Enable network policy",
104+
"description": "Only pod from the same namespace will be allowed",
105+
"default": false,
106+
"x-onyxia": {
107+
"overwriteDefaultWith": "region.defaultNetworkPolicy"
108+
}
109+
},
110+
"from": {
111+
"description": "Array of sources allowed to have network access to your service",
112+
"type": "array",
113+
"items": {
114+
"type": "object",
115+
"additionalProperties": true
109116
},
110-
"from": {
111-
"type": "array",
112-
"description": "Array of source allowed to have network access to your service",
113-
"default": [],
114-
"x-onyxia": {
115-
"hidden": true,
116-
"overwriteDefaultWith": "region.from"
117-
}
117+
"default": [],
118+
"x-onyxia": {
119+
"hidden": true,
120+
"overwriteDefaultWith": "region.from"
118121
}
122+
}
119123
}
120124
}
121125
}

0 commit comments

Comments
 (0)