Skip to content

Commit

Permalink
style: Add formatting rules and action
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperupcall authored and akinomyoga committed Apr 16, 2023
1 parent 11ab9e1 commit 3608cd8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

# Matches multiple files with brace expansion notation
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Check EditorConfig Format"
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
jobs:
lint:
runs-on: "ubuntu-22.04"
steps:
- name: "Get Changed Files"
id: "files"
uses: "masesgroup/retrieve-changed-files@v2"
with:
format: "json"
- name: Check out code.
uses: actions/checkout@v2
- name: "Check EditorConfig Lint"
run: |
sudo apt install -y jq golang
go install 'github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@latest'
readarray -t changed_files <<<"$(jq -r '.[]' <<<'${{ steps.files.outputs.added_modified }}')"
~/go/bin/editorconfig-checker ${changed_files[@]}

0 comments on commit 3608cd8

Please sign in to comment.