Skip to content

Commit d7f473a

Browse files
committed
refactor: apply linter
1 parent 0411ccd commit d7f473a

Some content is hidden

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

43 files changed

+956
-913
lines changed

.eslintrc.cjs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,18 @@ testOverrides.rules['@typescript-eslint/no-floating-promises'] = 'off';
77

88

99
cfg.overrides.push({
10-
/** Overrides for JSON */
11-
files: ['**/*.yaml'],
10+
/** Overrides for YAML */
11+
files: ['*.yaml', '*.yml'],
1212
extends: ['plugin:yml/standard'],
13-
rules: { 'yml/quotes': ['error',{ prefer: 'single' }] },
13+
rules: {
14+
// Prettier uses single quotes so be consistent
15+
'yml/quotes': ['error', { prefer: 'single' }],
16+
// Prettier will reformat this back into a single line
17+
'yml/block-sequence-hyphen-indicator-newline': ['off'],
18+
// Prettier will sometimes convert these to multiline, so be safe and always use multi
19+
'yml/block-sequence': ['error', { singleline: 'always' }],
20+
},
21+
parser: 'yaml-eslint-parser'
1422
});
1523

1624
module.exports = cfg;

cdk8s.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
app: npx tsx infra/cdk8s.ts
22
language: typescript
33
imports:
4-
- https://raw.githubusercontent.com/aws/karpenter/main/pkg/apis/crds/karpenter.sh_provisioners.yaml
5-
- https://raw.githubusercontent.com/aws/karpenter/main/pkg/apis/crds/karpenter.k8s.aws_awsnodetemplates.yaml
4+
- 'https://raw.githubusercontent.com/aws/karpenter/main/pkg/apis/crds/karpenter.sh_provisioners.yaml'
5+
- 'https://raw.githubusercontent.com/aws/karpenter/main/pkg/apis/crds/karpenter.k8s.aws_awsnodetemplates.yaml'

docs/training/examples/wf_hello_world.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
namespace: argo
77
spec:
88
nodeSelector:
9-
karpenter.sh/capacity-type: 'spot'
9+
karpenter.sh/capacity-type: spot
1010
entrypoint: main
1111
templates:
1212
- name: main
@@ -17,5 +17,7 @@ spec:
1717
- name: say-hello-template
1818
container:
1919
image: '019359803926.dkr.ecr.ap-southeast-2.amazonaws.com/topo-imagery:v3'
20-
command: [echo]
21-
args: ['hello world']
20+
command:
21+
- echo
22+
args:
23+
- hello world

docs/training/examples/wf_hello_world_args.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ metadata:
66
namespace: argo
77
spec:
88
nodeSelector:
9-
karpenter.sh/capacity-type: 'spot'
9+
karpenter.sh/capacity-type: spot
1010
entrypoint: main
1111
arguments:
1212
parameters:
1313
- name: message
14-
value: 'hello world'
14+
value: hello world
1515
templates:
1616
- name: main
1717
dag:
@@ -28,5 +28,7 @@ spec:
2828
- name: message
2929
container:
3030
image: '019359803926.dkr.ecr.ap-southeast-2.amazonaws.com/topo-imagery:v3'
31-
command: [echo]
32-
args: ['{{inputs.parameters.message}}']
31+
command:
32+
- echo
33+
args:
34+
- '{{inputs.parameters.message}}'

docs/training/examples/wf_hello_world_args_tasks.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ metadata:
66
namespace: argo
77
spec:
88
nodeSelector:
9-
karpenter.sh/capacity-type: 'spot'
9+
karpenter.sh/capacity-type: spot
1010
entrypoint: main
1111
arguments:
1212
parameters:
1313
- name: message1
14-
value: 'hello world 1'
14+
value: hello world 1
1515
- name: message2
16-
value: 'hello world 2'
16+
value: hello world 2
1717
templates:
1818
- name: main
1919
dag:
@@ -36,5 +36,7 @@ spec:
3636
- name: message
3737
container:
3838
image: '019359803926.dkr.ecr.ap-southeast-2.amazonaws.com/topo-imagery:v3'
39-
command: [echo]
40-
args: ['{{inputs.parameters.message}}']
39+
command:
40+
- echo
41+
args:
42+
- '{{inputs.parameters.message}}'

docs/training/examples/wf_hello_world_dag.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ metadata:
66
namespace: argo
77
spec:
88
nodeSelector:
9-
karpenter.sh/capacity-type: 'spot'
9+
karpenter.sh/capacity-type: spot
1010
entrypoint: main
1111
arguments:
1212
parameters:
1313
- name: message1
14-
value: 'hello world 1'
14+
value: hello world 1
1515
- name: message2
16-
value: 'hello world 2'
16+
value: hello world 2
1717
templates:
1818
- name: main
1919
dag:
@@ -30,26 +30,28 @@ spec:
3030
parameters:
3131
- name: message
3232
value: '{{workflow.parameters.message2}}'
33-
depends: 'say-hello-task1'
33+
depends: say-hello-task1
3434
- name: say-hello-task3
3535
template: say-hello-template
3636
arguments:
3737
parameters:
3838
- name: message
39-
value: 'say hello task 3'
40-
depends: 'say-hello-task1'
39+
value: say hello task 3
40+
depends: say-hello-task1
4141
- name: say-hello-task4
4242
template: say-hello-template
4343
arguments:
4444
parameters:
4545
- name: message
46-
value: 'say hello task 4'
46+
value: say hello task 4
4747
depends: 'say-hello-task2 && say-hello-task3'
4848
- name: say-hello-template
4949
inputs:
5050
parameters:
5151
- name: message
5252
container:
5353
image: '019359803926.dkr.ecr.ap-southeast-2.amazonaws.com/topo-imagery:v3'
54-
command: [echo]
55-
args: ['{{inputs.parameters.message}}']
54+
command:
55+
- echo
56+
args:
57+
- '{{inputs.parameters.message}}'

docs/training/examples/wf_output_parallel.yaml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
spec:
77
parallelism: 20
88
nodeSelector:
9-
karpenter.sh/capacity-type: 'spot'
9+
karpenter.sh/capacity-type: spot
1010
serviceAccountName: workflow-runner-sa
1111
entrypoint: main
1212
arguments:
@@ -27,14 +27,14 @@ spec:
2727
- name: uri
2828
value: '{{workflow.parameters.uri}}'
2929
- name: include
30-
value: 'json$'
30+
value: json$
3131
- name: stac-print-path
3232
template: stac-print-path
3333
arguments:
3434
parameters:
3535
- name: file
3636
value: '{{item}}'
37-
depends: 'aws-list'
37+
depends: aws-list
3838
withParam: '{{tasks.aws-list.outputs.parameters.files}}'
3939
- name: aws-list
4040
inputs:
@@ -45,19 +45,18 @@ spec:
4545
image: '019359803926.dkr.ecr.ap-southeast-2.amazonaws.com/argo-tasks:v2'
4646
env:
4747
- name: AWS_ROLE_CONFIG_PATH
48-
value: s3://linz-bucket-config/config.json
48+
value: 's3://linz-bucket-config/config.json'
4949
args:
50-
[
51-
'list',
52-
'--verbose',
53-
'--include',
54-
'{{inputs.parameters.include}}',
55-
'--group',
56-
'4',
57-
'--output',
58-
'/tmp/file_list.json',
59-
'{{inputs.parameters.uri}}',
60-
]
50+
- list
51+
- --verbose
52+
- --include
53+
- '{{inputs.parameters.include}}'
54+
- --group
55+
- '4'
56+
- --output
57+
- /tmp/file_list.json
58+
- '{{inputs.parameters.uri}}'
59+
6160
outputs:
6261
parameters:
6362
- name: files
@@ -71,9 +70,9 @@ spec:
7170
image: '019359803926.dkr.ecr.ap-southeast-2.amazonaws.com/argo-tasks:v2'
7271
env:
7372
- name: AWS_ROLE_CONFIG_PATH
74-
value: s3://linz-bucket-config/config.json
73+
value: 's3://linz-bucket-config/config.json'
7574
command:
76-
- 'bash'
75+
- bash
7776
source: |
7877
PATH_OUT=$(echo "{{inputs.parameters.file}}" | sed 's/,/ /g; s/\[/ /g; s/\]/ /g')
7978
echo $PATH_OUT

templates/argo-tasks/copy.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ spec:
2121

2222
- name: version_argo_tasks
2323
description: version of argo-tasks to use
24-
default: 'v4'
24+
default: v4
2525

2626
- name: copy_option
27-
description: --no-clobber Skip overwriting existing files. --force Overwrite all files. --force-no-clobber Overwrite only changed files, skip unchanged files.
28-
default: '--no-clobber'
27+
description: '--no-clobber Skip overwriting existing files. --force Overwrite all files. --force-no-clobber Overwrite only changed files, skip unchanged files.'
28+
default: --no-clobber
2929
enum:
30-
- '--no-clobber'
31-
- '--force'
32-
- '--force-no-clobber'
30+
- --no-clobber
31+
- --force
32+
- --force-no-clobber
3333

3434
- name: aws_role_config_path
3535
description: s3 URL or comma-separated list of s3 URLs allowing the workflow to write to a target(s)
@@ -44,4 +44,7 @@ spec:
4444
env:
4545
- name: AWS_ROLE_CONFIG_PATH
4646
value: '{{inputs.parameters.aws_role_config_path}},s3://linz-bucket-config/config.json'
47-
args: ['copy', '{{inputs.parameters.copy_option}}', '{{inputs.parameters.file}}']
47+
args:
48+
- copy
49+
- '{{inputs.parameters.copy_option}}'
50+
- '{{inputs.parameters.file}}'

templates/argo-tasks/create-manifest.yml

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ spec:
2424

2525
- name: version_argo_tasks
2626
description: version of argo-tasks to use
27-
default: 'v4'
27+
default: v4
2828

2929
- name: include
3030
description: A regular expression to match object path(s) or name(s) from within the source path to include in the copy
@@ -35,12 +35,12 @@ spec:
3535
default: ''
3636

3737
- name: copy_option
38-
description: --no-clobber Skip overwriting existing files. --force Overwrite all files. --force-no-clobber Overwrite only changed files, skip unchanged files.
39-
default: '--no-clobber'
38+
description: '--no-clobber Skip overwriting existing files. --force Overwrite all files. --force-no-clobber Overwrite only changed files, skip unchanged files.'
39+
default: --no-clobber
4040
enum:
41-
- '--no-clobber'
42-
- '--force'
43-
- '--force-no-clobber'
41+
- --no-clobber
42+
- --force
43+
- --force-no-clobber
4444

4545
- name: flatten
4646
description: Flatten the files in the target location
@@ -55,11 +55,11 @@ spec:
5555

5656
- name: group_size
5757
description: The maximum group size of files for each pod to copy (will use the value of `group` or `group_size` that is reached first)
58-
default: '100Gi'
58+
default: 100Gi
5959

6060
- name: transform
61-
description: String to be transformed from source to target to renamed filenames, e.g. `f.replace("text to replace", "new_text_to_use")`. Leave as `f` for no transformation.
62-
default: 'f'
61+
description: 'String to be transformed from source to target to renamed filenames, e.g. `f.replace("text to replace", "new_text_to_use")`. Leave as `f` for no transformation.'
62+
default: f
6363

6464
outputs:
6565
parameters:
@@ -69,28 +69,28 @@ spec:
6969

7070
container:
7171
image: '019359803926.dkr.ecr.ap-southeast-2.amazonaws.com/argo-tasks:{{=sprig.trim(inputs.parameters.version_argo_tasks)}}'
72-
command: [node, /app/index.js]
72+
command:
73+
- node
74+
- /app/index.js
7375
env:
7476
- name: AWS_ROLE_CONFIG_PATH
75-
value: s3://linz-bucket-config/config.json
77+
value: 's3://linz-bucket-config/config.json'
7678
args:
77-
[
78-
'create-manifest',
79-
'--verbose',
80-
'--include',
81-
'{{=sprig.trim(inputs.parameters.include)}}',
82-
'--exclude',
83-
'{{inputs.parameters.exclude}}',
84-
'--flatten={{=sprig.trim(inputs.parameters.flatten)}}',
85-
'--group',
86-
'{{=sprig.trim(inputs.parameters.group)}}',
87-
'--group-size',
88-
'{{=sprig.trim(inputs.parameters.group_size)}}',
89-
'--output',
90-
'/tmp/file_list.json',
91-
'--target',
92-
'{{=sprig.trim(inputs.parameters.target)}}',
93-
'{{=sprig.trim(inputs.parameters.source)}}',
94-
'--transform',
95-
'{{=sprig.trim(inputs.parameters.transform)}}',
96-
]
79+
- create-manifest
80+
- --verbose
81+
- --include
82+
- '{{=sprig.trim(inputs.parameters.include)}}'
83+
- --exclude
84+
- '{{inputs.parameters.exclude}}'
85+
- '--flatten={{=sprig.trim(inputs.parameters.flatten)}}'
86+
- --group
87+
- '{{=sprig.trim(inputs.parameters.group)}}'
88+
- --group-size
89+
- '{{=sprig.trim(inputs.parameters.group_size)}}'
90+
- --output
91+
- /tmp/file_list.json
92+
- --target
93+
- '{{=sprig.trim(inputs.parameters.target)}}'
94+
- '{{=sprig.trim(inputs.parameters.source)}}'
95+
- --transform
96+
- '{{=sprig.trim(inputs.parameters.transform)}}'

templates/argo-tasks/generate-path.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ spec:
1919
- name: source
2020
description: s3 path of source data
2121
- name: target_bucket_name
22-
description: target bucket name e.g. 'nz-imagery'
22+
description: "target bucket name e.g. 'nz-imagery'"
2323
- name: version
2424
description: argo-task Container version to use
25-
default: 'v4'
25+
default: v4
2626

2727
container:
2828
image: '019359803926.dkr.ecr.ap-southeast-2.amazonaws.com/argo-tasks:{{= inputs.parameters.version }}'
2929
env:
3030
- name: AWS_ROLE_CONFIG_PATH
31-
value: s3://linz-bucket-config/config.json
31+
value: 's3://linz-bucket-config/config.json'
3232
args:
33-
- 'generate-path'
34-
- '--target-bucket-name'
33+
- generate-path
34+
- --target-bucket-name
3535
- '{{=sprig.trim(inputs.parameters.target_bucket_name)}}'
3636
- '{{=sprig.trim(inputs.parameters.source)}}'
3737

@@ -40,4 +40,4 @@ spec:
4040
- name: target
4141
description: ODR target path
4242
valueFrom:
43-
path: '/tmp/generate-path/target'
43+
path: /tmp/generate-path/target

0 commit comments

Comments
 (0)