diff options
author | dundargoc <33953936+dundargoc@users.noreply.github.com> | 2021-09-26 21:13:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-26 12:13:59 -0700 |
commit | 3246bf5f4e24025b4a14ed99eeb4a8f954626519 (patch) | |
tree | ec5b8789eadf775e0151c0e6d3db7835973ae30b | |
parent | 9686c21237cab5d0035cfed181f5f5cdcc90bd5a (diff) | |
download | rneovim-3246bf5f4e24025b4a14ed99eeb4a8f954626519.tar.gz rneovim-3246bf5f4e24025b4a14ed99eeb4a8f954626519.tar.bz2 rneovim-3246bf5f4e24025b4a14ed99eeb4a8f954626519.zip |
ci(lintcommit.lua): replace third-party commitlint #15747
-rw-r--r-- | .github/workflows/commitlint.config.js | 35 | ||||
-rw-r--r-- | .github/workflows/commitlint.config_patch.js | 27 | ||||
-rw-r--r-- | .github/workflows/commitlint.yml | 12 | ||||
-rw-r--r-- | scripts/lintcommit.lua | 2 |
4 files changed, 6 insertions, 70 deletions
diff --git a/.github/workflows/commitlint.config.js b/.github/workflows/commitlint.config.js deleted file mode 100644 index 5f10ffc6f4..0000000000 --- a/.github/workflows/commitlint.config.js +++ /dev/null @@ -1,35 +0,0 @@ -module.exports = { - rules: { - 'body-leading-blank': [1, 'always'], - 'body-max-line-length': [2, 'always', 100], - 'footer-leading-blank': [1, 'always'], - 'footer-max-line-length': [2, 'always', 100], - 'header-max-length': [2, 'always', 100], - 'scope-case': [2, 'always', 'lower-case'], - 'subject-case': [ - 2, - 'never', - ['sentence-case', 'start-case', 'pascal-case', 'upper-case'], - ], - 'subject-empty': [2, 'never'], - 'subject-full-stop': [2, 'never', '.'], - 'type-case': [2, 'always', 'lower-case'], - 'type-empty': [2, 'never'], - 'type-enum': [ - 2, - 'always', - [ - 'build', - 'chore', - 'ci', - 'docs', - 'feat', - 'fix', - 'perf', - 'refactor', - 'revert', - 'test', - ], - ], - }, -}; diff --git a/.github/workflows/commitlint.config_patch.js b/.github/workflows/commitlint.config_patch.js deleted file mode 100644 index ca398c45dc..0000000000 --- a/.github/workflows/commitlint.config_patch.js +++ /dev/null @@ -1,27 +0,0 @@ -module.exports = { - parserPreset: { - parserOpts: { headerPattern: /^([^\(\):]*)(?:\((.*)\))?!?:(.*)$/ } - }, - rules: { - 'body-leading-blank': [1, 'always'], - 'body-max-line-length': [2, 'always', 100], - 'footer-max-line-length': [2, 'always', 100], - 'scope-case': [2, 'always', 'lower-case'], - 'subject-case': [ - 2, - 'never', - ['sentence-case', 'start-case', 'pascal-case', 'upper-case'], - ], - 'subject-empty': [2, 'never'], - 'subject-full-stop': [2, 'never', '.'], - 'type-case': [2, 'always', 'lower-case'], - 'type-empty': [2, 'never'], - 'type-enum': [ - 2, - 'always', - [ - 'vim-patch', - ], - ], - }, -}; diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index 9ae138fbd7..4c9c526946 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -9,10 +9,8 @@ jobs: - uses: actions/checkout@v2.3.1 with: fetch-depth: 0 - - run: npm install --save-dev @commitlint/cli - - run: | - if [[ "$(gh pr view ${{ github.event.pull_request.number }} --json commits --jq '.[][0].messageHeadline')" == vim-patch* ]];then - npx commitlint --from HEAD~1 --to HEAD --verbose --help-url https://github.com/neovim/neovim/blob/master/CONTRIBUTING.md#commit-messages --config .github/workflows/commitlint.config_patch.js - else - npx commitlint --from HEAD~1 --to HEAD --verbose --help-url https://github.com/neovim/neovim/blob/master/CONTRIBUTING.md#commit-messages --config .github/workflows/commitlint.config.js - fi + - uses: rhysd/action-setup-vim@v1 + with: + neovim: true + - run: gh pr checkout ${{ github.event.pull_request.number }} + - run: nvim --clean -es +"lua require('scripts.lintcommit').main({trace=true})" diff --git a/scripts/lintcommit.lua b/scripts/lintcommit.lua index 11ad8eb9ef..98f9da246c 100644 --- a/scripts/lintcommit.lua +++ b/scripts/lintcommit.lua @@ -91,7 +91,7 @@ local function validate_commit(commit_message) -- Check that description doesn't end with a period if vim.endswith(after_colon, ".") then - return [[Description ends with a period (\".\").]] + return [[Description ends with a period (".").]] end -- Check that description has exactly one whitespace after colon, followed by |