From 4a8df6d3224cbf1fa3b7b4b74a1259551b48569c Mon Sep 17 00:00:00 2001 From: Tulio Leao Date: Fri, 1 May 2020 21:04:06 -0300 Subject: [PATCH] Enable commitlint for pull requests and commits (#11410) * Enable commitlint for pull requests and commits Refer to https://commitlint.js.org/#/reference-rules for rules --- .commitlint.json | 68 ++++++++++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 14 +++++++++ 2 files changed, 82 insertions(+) create mode 100644 .commitlint.json diff --git a/.commitlint.json b/.commitlint.json new file mode 100644 index 0000000000..dbf76c1f6a --- /dev/null +++ b/.commitlint.json @@ -0,0 +1,68 @@ + +{ + "rules": { + "body-leading-blank": [ + 2, + "always" + ], + "body-max-length": [ + 0 + ], + "body-min-length": [ + 0 + ], + "footer-leading-blank": [ + 2, + "always" + ], + "footer-max-length": [ + 0 + ], + "footer-min-length": [ + 0 + ], + "header-max-length": [ + 2, + "always", + 72 + ], + "header-min-length": [ + 2, + "always", + 10 + ], + "scope-empty": [ + 0 + ], + "subject-case": [ + 0 + ], + "subject-empty": [ + 0 + ], + "subject-full-stop": [ + 0 + ], + "subject-max-length": [ + 0 + ], + "subject-min-length": [ + 0 + ], + "type-case": [ + 0 + ], + "type-empty": [ + 0 + ], + "type-enum": [ + 0 + ], + "type-max-length": [ + 0 + ], + "type-min-length": [ + 0 + ] + } +} \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8cf76b8a04..4ae55a3ff9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,20 @@ env: BACKTRACE_IO_TOKEN: ${{ secrets.BACKTRACE_IO_TOKEN }} OPENRCT2_VERSION: 0.2.6 jobs: + lint-commit: + name: Lint Commit Message + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Lint Commit Messages + uses: wagoid/commitlint-github-action@v1 + with: + configFile: .commitlint.json check-code-formatting: name: Check code formatting runs-on: ubuntu-latest