Skip to content

Commit e027608

Browse files
authored
improvement/added-pre-commit-and-linting (#125)
* Pre commit with prettier Linter run * improvement/added pre commit and linting * Version bump * Conf for linter * improvement/added pre commit and linting * improvement/added pre commit and linting * improvement/added pre commit and linting
1 parent 26bf53f commit e027608

13 files changed

+73
-26
lines changed

.github/pull_request_template.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ Thanks for submitting a PR! Please check the boxes below:
22

33
- [ ] I have filled in the "Changes" section below?
44
- [ ] I have filled in the "How did you test this code" section below?
5-
- [ ] I have bumped the version number in `/charts/flagsmith/Chart.yaml` in the section `version` or I'm merging to a release branch
5+
- [ ] I have bumped the version number in `/charts/flagsmith/Chart.yaml` in the section `version` or I'm merging to a
6+
release branch
67

78
## Changes
89

9-
*Please describe.*
10+
_Please describe._
1011

1112
## How did you test this code?
1213

1314
<!-- If the answer is manually, please include a quick step-by-step on how to test this PR. -->
1415

15-
*Please describe.*
16+
_Please describe._

.github/workflows/lint-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
fi
4343
4444
- name: Run chart-testing (lint)
45-
run: ct lint --config ct.yaml
45+
run: ct lint --config ct.yaml --lint-conf lintconf.yaml
4646

4747
- name: Create kind cluster
4848
uses: helm/[email protected]

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ jobs:
3535
- name: Run chart-releaser
3636
uses: helm/[email protected]
3737
env:
38-
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
38+
CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ venv/
44
.envrc
55
.vscode
66
charts/*/charts
7+
.direnv

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.4.0
4+
hooks:
5+
- id: check-yaml
6+
- repo: https://github.com/pre-commit/mirrors-prettier
7+
rev: v2.7.1
8+
hooks:
9+
- id: prettier

.prettierrc.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"proseWrap": "always",
3+
"singleQuote": true,
4+
"printWidth": 120,
5+
"trailingComma": "all",
6+
"tabWidth": 4,
7+
"overrides": [
8+
{
9+
"files": "**/*.md",
10+
"options": {
11+
"tabWidth": 1
12+
}
13+
},
14+
{
15+
"files": ["**/*.yml", "**/*.yaml"],
16+
"options": {
17+
"tabWidth": 2
18+
}
19+
}
20+
]
21+
}

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Flagsmith Charts
22

3-
Official Helm charts for Flagsmith, [https://flagsmith.github.io/flagsmith-charts/](https://flagsmith.github.io/flagsmith-charts/)
3+
Official Helm charts for Flagsmith,
4+
[https://flagsmith.github.io/flagsmith-charts/](https://flagsmith.github.io/flagsmith-charts/)
45

56
- [Flagsmith](./charts/flagsmith/)
67

@@ -16,7 +17,16 @@ Or by adding the following into `helmfile.yaml`:
1617

1718
```yaml
1819
repositories:
19-
# ...
20-
- name: flagsmith
21-
url: https://flagsmith.github.io/flagsmith-charts/
20+
# ...
21+
- name: flagsmith
22+
url: https://flagsmith.github.io/flagsmith-charts/
23+
```
24+
25+
## Development
26+
27+
We use [pre-commit](https://pre-commit.com/index.html#install) for linting. You can install and run with:
28+
29+
```bash
30+
pip install pre-commit
31+
pre-commit run --all-files
2232
```

charts/flagsmith/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: flagsmith
33
description: Flagsmith
44
type: application
5-
version: 0.16.0
5+
version: 0.16.1
66
appVersion: 2.42.1
77
dependencies:
88
- name: postgresql

charts/flagsmith/OPENSHIFT.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
# Openshift
22

3-
In order to install Flagsmith to OpenShift you need to provide the domain of the OpenShift cluster and the destination namespace in the helm call. Futhermore, you need to include the values files `openshift` in order to create the routes for the Flagsmith deployments. The command looks likes this:
3+
In order to install Flagsmith to OpenShift you need to provide the domain of the OpenShift cluster and the destination
4+
namespace in the helm call. Futhermore, you need to include the values files `openshift` in order to create the routes
5+
for the Flagsmith deployments. The command looks likes this:
46

5-
``` bash
7+
```bash
68
helm install flagsmith ./flagsmith-kubernetes -f flagsmith-kubernetes/openshift-values.yaml --set frontend.env[0].name=API_URL,frontend.env[0].value=http://flagsmith-api-<Release Namespace>.<OpenShift domain>/api/v1/,frontend.env[1].name=ASSET_URL,frontend.env[1].value=/ --set openshiftdomain=<OpenShift domain>
79
```
810

911
An example for the Flagsmith installation for a minishift cluster looks like this:
1012

11-
``` bash
13+
```bash
1214
helm install flagsmith ./flagsmith-kubernetes -f flagsmith-kubernetes/openshift-values.yaml --set frontend.env[0].name=API_URL,frontend.env[0].value=http://flagsmith-api-flagsmith.my.openshift.domain.com/api/v1/,frontend.env[1].name=ASSET_URL,frontend.env[1].value=/ --set openshiftdomain=my.openshift.domain.com --dry-run
1315
```

charts/flagsmith/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# Flagsmith Helm chart
22

3-
For documentation on this Helm chart, please refer to the [Flagsmith Docs](https://docs.flagsmith.com/deployment/kubernetes).
3+
For documentation on this Helm chart, please refer to the
4+
[Flagsmith Docs](https://docs.flagsmith.com/deployment/kubernetes).
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
postgresql:
22
volumePermissions:
3-
securityContext:
4-
runAsUser:"auto"
3+
securityContext: runAsUser:"auto"
54
securityContext:
65
enabled: false
7-
fsGroup: "0"
8-
openshift: true
6+
fsGroup: '0'
7+
openshift: true

charts/flagsmith/values.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
api:
22
image:
33
repository: flagsmith/flagsmith-api
4-
tag: null # defaults to .Chart.AppVersion
4+
tag: null # defaults to .Chart.AppVersion
55
imagePullPolicy: IfNotPresent
66
imagePullSecrets: []
77
# Note that if setting this to false, need to set
@@ -78,7 +78,7 @@ frontend:
7878
enabled: true
7979
image:
8080
repository: flagsmith/flagsmith-frontend
81-
tag: null # defaults to .Chart.AppVersion
81+
tag: null # defaults to .Chart.AppVersion
8282
imagePullPolicy: IfNotPresent
8383
imagePullSecrets: []
8484
replicacount: 1
@@ -223,14 +223,14 @@ pgbouncer:
223223
influxdb2:
224224
enabled: true
225225
adminUser:
226-
organization: "influxdata"
227-
bucket: "default"
228-
user: "admin"
229-
retention_policy: "0s"
226+
organization: 'influxdata'
227+
bucket: 'default'
228+
user: 'admin'
229+
retention_policy: '0s'
230230
## Leave empty to generate a random password and token.
231231
## Or fill any of these values to use fixed values.
232-
password: ""
233-
token: ""
232+
password: ''
233+
token: ''
234234
persistence:
235235
enabled: false
236236
# storageClass: "-"

lintconf.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
rules:
2+
comments:
3+
min-spaces-from-content: 1

0 commit comments

Comments
 (0)