From 1fc620464b295d969c53dbbb39ab118710f982a6 Mon Sep 17 00:00:00 2001 From: Owais Kazi Date: Tue, 19 Jul 2022 13:20:34 -0700 Subject: [PATCH] Added a new line linter (#55) * added a new line linter Signed-off-by: Owais Kazi * PR comment Signed-off-by: Owais Kazi --- .github/workflows/code-hygiene.yml | 14 ++++++++++++++ .linelint.yml | 18 ++++++++++++++++++ settings.gradle | 1 - 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/code-hygiene.yml create mode 100644 .linelint.yml diff --git a/.github/workflows/code-hygiene.yml b/.github/workflows/code-hygiene.yml new file mode 100644 index 00000000..a1adbb8a --- /dev/null +++ b/.github/workflows/code-hygiene.yml @@ -0,0 +1,14 @@ +name: Code Hygiene + +on: [pull_request] + +jobs: + linelint: + runs-on: ubuntu-latest + name: Check if all files end in newline + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Linelint + uses: fernandrone/linelint@0.0.4 diff --git a/.linelint.yml b/.linelint.yml new file mode 100644 index 00000000..116e1294 --- /dev/null +++ b/.linelint.yml @@ -0,0 +1,18 @@ +# 'true' will fix files +autofix: true + +ignore: + - CONTRIBUTING.md + - DEVELOPER_GUIDE.md + - SECURITY.md + - formatter/license-header.txt + - src/main/resources/log4j2.xml + +rules: + # checks if file ends in a newline character + end-of-file: + # set to true to enable this rule + enable: true + + # if true also checks if file ends in a single newline character + single-new-line: true diff --git a/settings.gradle b/settings.gradle index 8c502654..7186114e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1 @@ rootProject.name = 'IndependentPlugin' -