From 416c3b1417faf98d8d9350a81282ff089a6bc5c3 Mon Sep 17 00:00:00 2001 From: Owais Kazi Date: Mon, 18 Jul 2022 15:20:57 -0700 Subject: [PATCH 1/2] added a new line linter Signed-off-by: Owais Kazi --- .github/workflows/code-hygiene.yml | 14 ++++++++++++++ .linelint.yml | 19 +++++++++++++++++++ 2 files changed, 33 insertions(+) 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..531a780a --- /dev/null +++ b/.linelint.yml @@ -0,0 +1,19 @@ +# 'true' will fix files +autofix: true + +ignore: + - CONTRIBUTING.md + - DEVELOPER_GUIDE.md + - SECURITY.md + - formatter/license-header.txt + - settings.gradle + - 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 From 773d7a016d143c07b81df56c5a76b048790d57b0 Mon Sep 17 00:00:00 2001 From: Owais Kazi Date: Mon, 18 Jul 2022 16:05:29 -0700 Subject: [PATCH 2/2] PR comment Signed-off-by: Owais Kazi --- .linelint.yml | 1 - settings.gradle | 1 - 2 files changed, 2 deletions(-) diff --git a/.linelint.yml b/.linelint.yml index 531a780a..116e1294 100644 --- a/.linelint.yml +++ b/.linelint.yml @@ -6,7 +6,6 @@ ignore: - DEVELOPER_GUIDE.md - SECURITY.md - formatter/license-header.txt - - settings.gradle - src/main/resources/log4j2.xml rules: diff --git a/settings.gradle b/settings.gradle index 8c502654..7186114e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1 @@ rootProject.name = 'IndependentPlugin' -