From f37e3a7c839816823df541b57be9b8bfd09deb5a Mon Sep 17 00:00:00 2001 From: Serhiy Zahoriya Date: Thu, 19 Aug 2021 02:19:05 +0300 Subject: [PATCH] Infrastructure "editorconfig conformance check 1: no tabs" (#822) --- .editorconfig | 6 ++++ .../workflows/editorconfig_conformance.yml | 35 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 .github/workflows/editorconfig_conformance.yml 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