Skip to content

Commit dd6a49f

Browse files
authored
chore: update & apply new lint & format scripts (#62)
1 parent f994bb5 commit dd6a49f

File tree

16 files changed

+334
-352
lines changed

16 files changed

+334
-352
lines changed

.editorconfig

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
root = true
22

33
[*]
4-
indent_style = space
5-
indent_size = 2
64
charset = utf-8
75
trim_trailing_whitespace = true
86
insert_final_newline = true

.github/workflows/lint.yml

+4-24
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,9 @@ on:
77
pull_request:
88

99
jobs:
10-
shellcheck:
10+
lint:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: Checkout code
14-
uses: actions/checkout@v2
15-
16-
- name: Install asdf dependencies
17-
uses: asdf-vm/actions/install@v1
18-
19-
- name: Run ShellCheck
20-
run: scripts/shellcheck.bash
21-
22-
shellfmt:
23-
runs-on: ubuntu-latest
24-
steps:
25-
- name: Checkout code
26-
uses: actions/checkout@v2
27-
28-
- name: Install asdf dependencies
29-
uses: asdf-vm/actions/install@v1
30-
31-
- name: List file to shfmt
32-
run: shfmt -f .
33-
34-
- name: Run shfmt
35-
run: scripts/shfmt.bash
13+
- uses: actions/checkout@v2
14+
- uses: asdf-vm/actions/install@v1
15+
- run: scripts/lint.bash

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Contributions welcome!
2424
1. Develop!
2525
1. Lint & Format
2626
```shell
27-
./scripts/shellcheck.bash
28-
./scripts/shfmt.bash
27+
./scripts/format.bash
28+
./scripts/lint.bash
2929
```
3030
1. PR changes

scripts/format.bash

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
# format this repo
4+
shfmt --language-dialect bash --write \
5+
setup.bash \
6+
scripts/*.bash
7+
8+
# format the template/
9+
shfmt --language-dialect bash --write \
10+
template/**/*

scripts/lint.bash

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
# lint this repo
4+
shellcheck --shell=bash --external-sources \
5+
setup.bash \
6+
scripts/*
7+
8+
shfmt --language-dialect bash --diff \
9+
setup.bash \
10+
scripts/*
11+
12+
# lint the template/
13+
shellcheck --shell=bash --external-sources \
14+
template/bin/* --source-path=template/lib/ \
15+
template/lib/* \
16+
template/scripts/*
17+
18+
shfmt --language-dialect bash --diff \
19+
template/**/*

scripts/shellcheck.bash

-5
This file was deleted.

scripts/shfmt.bash

-3
This file was deleted.

0 commit comments

Comments
 (0)