Skip to content

Commit ff9ebac

Browse files
committed
scripts: Add shfmt
1 parent afc0f21 commit ff9ebac

File tree

131 files changed

+4256
-4221
lines changed

Some content is hidden

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

131 files changed

+4256
-4221
lines changed

.pre-commit-config.yaml

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ repos:
44
hooks:
55
- id: check-executables-have-shebangs
66
- id: check-merge-conflict
7+
exclude: ^helmfile.d/upstream/opensearch-project/opensearch/CHANGELOG.md$
78
- id: check-json
89
exclude: ^helmfile\.d/upstream/
910
- id: check-toml
@@ -22,16 +23,52 @@ repos:
2223
- id: trailing-whitespace
2324
exclude: ^helmfile\.d/upstream/|^tests/.*/.*\.out$
2425

25-
- repo: https://github.com/koalaman/shellcheck-precommit
26-
rev: v0.10.0
26+
- repo: local
2727
hooks:
28+
- id: generate-cypress-tests
29+
name: generate cypress tests
30+
language: script
31+
require_serial: true
32+
files: '.*\.cy.js'
33+
entry: tests/common/gen.bash
34+
args:
35+
- cypress
36+
37+
- id: generate-template-tests
38+
name: generate template tests
39+
language: script
40+
require_serial: true
41+
files: '.*\.bats.gotmpl'
42+
entry: tests/common/gen.bash
43+
args:
44+
- template
45+
2846
- id: shellcheck
2947
name: check scripts
30-
exclude: ^helmfile\.d/charts/opensearch/configurer/files/|^helmfile\.d/upstream/
48+
types: [shell]
49+
exclude_types: [csh, tcsh, zsh]
50+
exclude: ^helmfile\.d/charts/opensearch/configurer/files/|^helmfile\.d/upstream/|^images/elasticsearch-curator/
51+
language: script
52+
require_serial: true
53+
entry: scripts/run-from-container.sh
54+
args:
55+
- --network=none
56+
- docker.io/koalaman/shellcheck:v0.10.0@sha256:2097951f02e735b613f4a34de20c40f937a6c8f18ecb170612c88c34517221fb
57+
- --color=always
58+
- --external-sources
59+
60+
- id: shfmt
61+
name: format scripts
62+
types: [shell]
63+
exclude_types: [csh, tcsh, zsh]
64+
exclude: ^helmfile\.d/charts/opensearch/configurer/files/|^helmfile\.d/upstream/|^images/elasticsearch-curator/
65+
language: script
3166
require_serial: true
67+
entry: scripts/run-from-container.sh
3268
args:
33-
- --color=always
34-
- --external-sources
69+
- --network=none
70+
- docker.io/mvdan/shfmt:v3.10.0@sha256:d19cc37644449fe9a488f234d2c0cf0b770eaf6a5a40e30103e8099013ef8f9e
71+
- -w
3572

3673
- repo: https://github.com/codespell-project/codespell
3774
rev: v2.3.0
@@ -51,23 +88,3 @@ repos:
5188
exclude: ^changelog/|^docs/sbom.md$|^helmfile\.d/charts/opensearch/configurer/files/|^helmfile\.d/upstream/|^images/elasticsearch-curator/
5289
args:
5390
- --fix
54-
55-
- repo: local
56-
hooks:
57-
- id: generate-cypress-tests
58-
name: generate cypress tests
59-
language: script
60-
require_serial: true
61-
files: '.*\.cy.js'
62-
entry: tests/common/gen.bash
63-
args:
64-
- cypress
65-
66-
- id: generate-template-tests
67-
name: generate template tests
68-
language: script
69-
require_serial: true
70-
files: '.*\.bats.gotmpl'
71-
entry: tests/common/gen.bash
72-
args:
73-
- template

bin/apply.bash

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,14 @@ declare environment
6161

6262
case "${1:-}" in
6363
sc)
64-
environment="service_cluster" ;;
64+
environment="service_cluster"
65+
;;
6566
wc)
66-
environment="workload_cluster" ;;
67+
environment="workload_cluster"
68+
;;
6769
*)
68-
usage "${1:-}" ;;
70+
usage "${1:-}"
71+
;;
6972
esac
7073

7174
update_ips_dryrun "$1" "${environment}"

0 commit comments

Comments
 (0)