diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..84c37b2 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +root = true +[*] +indent_style = space +indent_size = 2 +shell_variant = bash +binary_next_line = true +switch_case_indent = true +space_redirects = true +keep_padding = true +function_next_line = false +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index adadfa1..716b663 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,3 +1,5 @@ +name: "Linting & Formatting" + on: - push - pull_request @@ -6,7 +8,14 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: ludeeus/action-shellcheck@master + - name: "Checkout" + uses: actions/checkout@v4 + + - name: "Lint check" + uses: ludeeus/action-shellcheck@master env: SHELLCHECK_OPTS: -x + - name: "Format check" + run: | + curl -sS https://webi.sh/shfmt | sh + shfmt -l -d . diff --git a/Brewfile b/Brewfile index 8900110..642a788 100644 --- a/Brewfile +++ b/Brewfile @@ -4,4 +4,5 @@ brew "yq" brew "coreutils" brew "oath-toolkit" brew "gnupg" +brew "shfmt" cask "session-manager-plugin"