From 2934e80eee20b60a64a5e4119501937f694b293a Mon Sep 17 00:00:00 2001 From: Alex Andru Date: Thu, 4 Jan 2024 02:43:44 +0100 Subject: [PATCH 1/2] Add audit.yml github action workflow --- .github/workflows/audit.yml | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/audit.yml diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml new file mode 100644 index 0000000..7c7ad70 --- /dev/null +++ b/.github/workflows/audit.yml @@ -0,0 +1,38 @@ +name: Code audit + +on: push + +jobs: + audit: + runs-on: ubuntu-latest + name: Code audit + + steps: + - name: ⬇ Git checkout + uses: actions/checkout@v3 + + - name: ❓ Check if .editorconfig exists + uses: andstor/file-existence-action@v2 + with: + files: '.editorconfig' + allow_failure: true + + - name: 🙈 Ensure node_modules is ignored by Git + uses: dkershner6/gitignore-parser@v2 + with: + must_deny: 'node_modules' + + - name: 💾 Install modules + run: npm ci + + - name: 🔍 ESLint validation + run: npx eslint --ignore-path .gitignore . --max-warnings 0 + + - name: 📏 Check commit message length + uses: gsactions/commit-message-checker@v2 + with: + pattern: '^[^#].{10,72}' + error: 'The commit message length must be between 10 and 72' + excludeDescription: 'true' # optional: this excludes the description body of a pull request + excludeTitle: 'true' # optional: this excludes the title of a pull request + checkAllCommitMessages: 'true' # optional: this checks all commits associated with a pull request From 9ca3bbfd57a41a959869181376fb6906773651d6 Mon Sep 17 00:00:00 2001 From: Alex Andru Date: Thu, 4 Jan 2024 02:44:58 +0100 Subject: [PATCH 2/2] Add .editorconfig --- .editorconfig | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..cb33f32 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +insert_final_newline = true