Add EditorConfig file (#1022)

This commit is contained in:
Edwin Kofler 2023-01-27 01:47:06 -08:00 committed by GitHub
parent e4e7310c49
commit 589ef33e35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 4 deletions

13
.editorconfig Normal file
View file

@ -0,0 +1,13 @@
root = true
[*]
indent_style = space
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.patch]
insert_final_newline = false
[*.md,*.patch]
trim_trailing_whitespace = false

View file

@ -1,23 +1,41 @@
name: ci name: ci
on: on:
push: push:
branches: [ master ] branches: [master]
pull_request: pull_request:
branches: [ master ] branches: [master]
jobs: 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[@]}
build: build:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
platform: platform:
- ubuntu-18.04 - ubuntu-22.04
- macos-latest - macos-latest
runs-on: ${{ matrix.platform }} runs-on: ${{ matrix.platform }}
steps: steps:
- name: Check out code. - name: Check out code.
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Linux Install - name: Linux Install
if: matrix.platform == 'ubuntu-18.04' if: matrix.platform == 'ubuntu-22.04'
run: | run: |
sudo apt-get install -y bsdmainutils sudo apt-get install -y bsdmainutils
- name: Script - name: Script