Skip to content

Commit 21588bb

Browse files
committed
chore: Add EditorConfig
1 parent e4e7310 commit 21588bb

File tree

2 files changed

+35
-4
lines changed

2 files changed

+35
-4
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
charset = utf-8
6+
trim_trailing_whitespace = true
7+
insert_final_newline = true
8+
9+
[*.patch]
10+
insert_final_newline = false
11+
12+
[*.md,*.patch]
13+
trim_trailing_whitespace = false

.github/workflows/ci.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,41 @@
11
name: ci
22
on:
33
push:
4-
branches: [ master ]
4+
branches: [master]
55
pull_request:
6-
branches: [ master ]
6+
branches: ['*']
77
jobs:
8+
lint:
9+
runs-on: 'ubuntu-22.04'
10+
steps:
11+
- name: 'Get Changed Files'
12+
id: 'files'
13+
uses: 'masesgroup/retrieve-changed-files@v2'
14+
with:
15+
format: 'json'
16+
- name: Check out code.
17+
uses: actions/checkout@v2
18+
- name: 'Check EditorConfig Lint'
19+
run: |
20+
sudo apt install -y jq golang
21+
go install 'github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@latest'
22+
23+
readarray -t changed_files <<<"$(jq -r '.[]' <<<'${{ steps.files.outputs.added_modified }}')"
24+
~/go/bin/editorconfig-checker ${changed_files[@]}
25+
826
build:
927
strategy:
1028
fail-fast: false
1129
matrix:
1230
platform:
13-
- ubuntu-18.04
31+
- ubuntu-22.04
1432
- macos-latest
1533
runs-on: ${{ matrix.platform }}
1634
steps:
1735
- name: Check out code.
1836
uses: actions/checkout@v2
1937
- name: Linux Install
20-
if: matrix.platform == 'ubuntu-18.04'
38+
if: matrix.platform == 'ubuntu-22.04'
2139
run: |
2240
sudo apt-get install -y bsdmainutils
2341
- name: Script

0 commit comments

Comments
 (0)