From 8ed9ed41368aedb0c1a36f41bc8c05404385490d Mon Sep 17 00:00:00 2001 From: Jannick Kremer Date: Fri, 26 Jul 2024 13:09:41 +0100 Subject: [PATCH] Add .editorconfig and CI check for trailing whitespace --- .editorconfig | 3 +++ .github/workflows/check-whitespace.yml | 18 ++++++++++++++++++ src/base/UFont.pas | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 .editorconfig create mode 100644 .github/workflows/check-whitespace.yml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..059c2d6d7 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,3 @@ +[*] +trim_trailing_whitespace = false +insert_final_newline = false diff --git a/.github/workflows/check-whitespace.yml b/.github/workflows/check-whitespace.yml new file mode 100644 index 000000000..26dfb5b06 --- /dev/null +++ b/.github/workflows/check-whitespace.yml @@ -0,0 +1,18 @@ +# Credit: https://github.com/zlib-ng/zlib-ng/blob/develop/.github/workflows/lint.yml +name: Lint +on: [pull_request] + +jobs: + lint: + name: Check trailing whitespace + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Whitespace errors + run: | + git config core.whitespace blank-at-eol + git diff --color --check ${{ github.event.pull_request.base.sha }} -- './src' ':!./src/lib' ':!./src/webSDK' diff --git a/src/base/UFont.pas b/src/base/UFont.pas index bc39f6826..6f9acef37 100644 --- a/src/base/UFont.pas +++ b/src/base/UFont.pas @@ -768,7 +768,7 @@ TBitmapFont = class(TFont) fAscender: integer; fDescender: integer; fWidths: array[0..255] of byte; //**< half widths - fOutline: integer; + fOutline: integer; fTempColor: TGLColor; //**< colours for the reflection procedure ResetIntern();