-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcmdx.yaml
57 lines (57 loc) · 2.2 KB
/
cmdx.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# yaml-language-server: $schema=https://raw.githubusercontent.com/suzuki-shunsuke/cmdx/refs/heads/main/json-schema/cmdx.json
tasks:
- name: fmt
usage: Format files
description: Run formatter depending on the language specified in a sub task
tasks:
- name: bash
description: Format Bash files using shfmt
# indent needs to be explicitly set because shfmt doesn't respect .editorconfig
# cf. https://github.com/mvdan/sh/issues/1090
script: shfmt {{if .write}}--write{{end}} --diff --indent 2 --language-dialect bash .
flags:
- name: write
short: w
usage: if true, overwrite malformed files with the formatted result
type: bool
default: false
- name: lua
description: Format Lua files using StyLua
script: stylua {{if not .write}}--check{{end}} --allow-hidden .
flags:
- name: write
short: w
usage: if true, overwrite malformed files with the formatted result
type: bool
default: false
- name: toml
description: Format TOML files using Taplo
script: taplo format {{if not .write}}--check{{end}} --diff
flags:
- name: write
short: w
usage: if true, overwrite malformed files with the formatted result
type: bool
default: false
- name: yaml
description: Format YAML files using yamlfmt
script: yamlfmt {{if not .write}}--lint{{end}} .
flags:
- name: write
short: w
usage: if true, overwrite malformed files with the formatted result
type: bool
default: false
- name: lint
usage: Lint files
description: Run linter depending on the language specified in a sub task
tasks:
- name: bash
description: Lint Bash files usign ShellCheck
script: find . -type f -name '*.sh' -exec shellcheck --shell=bash --external-sources {} +
- name: lua
description: Lint Lua files using selene
script: selene .
- name: workflow
description: Lint GitHub Actions workflow files using actionlint
script: actionlint