diff --git a/.editorconfig b/.editorconfig index 8963b1270a..580afd5f26 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,6 +1,8 @@ # Editor configuration normalization # https://editorconfig.org/ +# See also .github/workflows/editorconfig_conformance.yml + # This is the top-most .editorconfig file; do not search in parent directories. root = true @@ -17,3 +19,7 @@ indent_size = 2 [*.py] indent_style = space indent_size = 4 + +[*.yml] +indent_style = space +indent_size = 2 diff --git a/.github/workflows/editorconfig_conformance.yml b/.github/workflows/editorconfig_conformance.yml new file mode 100644 index 0000000000..1f4b0fbd4b --- /dev/null +++ b/.github/workflows/editorconfig_conformance.yml @@ -0,0 +1,35 @@ +name: editorconfig conformance check + +on: + push: + branches: + - master + paths: + - '*.json' + - '.github/workflows/editorconfig_conformance.yml' + pull_request: + branches: + - master + paths: + - '*.json' + - '.github/workflows/editorconfig_conformance.yml' + +jobs: + build: + name: CI job + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v2 + + - name: Checkout base_ref + run: git fetch --depth=1 origin +${{ github.base_ref }} + + - name: Verify there are no tabs in JSON and py + id: build + run: | + git diff origin/${{ github.base_ref }} --name-only '*.json' '*.py' \ + | xargs -d'\n' git diff -U0 origin/${{ github.base_ref }} -- \ + | grep $'^+.*\t' \ + && exit 1 \ + || exit 0