Merge pull request #12715 from opensourcerouting/fix/contribution_guid_squash_random_commits

Commits hygiene
This commit is contained in:
Jafar Al-Gharaibeh 2023-02-07 10:42:53 -06:00 committed by GitHub
commit 6e1ae0137d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 103 additions and 0 deletions

44
.github/commitlint.config.js vendored Normal file
View File

@ -0,0 +1,44 @@
module.exports = {
rules: {
'header-max-length': [2, 'always', 72],
'type-case': [2, 'always', 'lower-case'],
'type-empty': [2, 'never'],
'type-enum': [
2,
'always',
[
'babeld',
'bfdd',
'bgpd',
'doc',
'docker',
'eigrpd',
'fpm',
'isisd',
'ldpd',
'lib',
'multi',
'nhrpd',
'ospf6d',
'ospfd',
'pbrd',
'pimd',
'pim6d',
'ripd',
'ripngd',
'sharpd',
'staticd',
'tests',
'tools',
'vtysh',
'vrrpd',
'yang',
'zebra',
'all',
],
],
'subject-empty': [2, 'never'],
'subject-full-stop': [2, 'never', '.'],
'subject-case': [2, 'always', 'sentence-case'],
},
};

19
.github/workflows/commitlint.yml vendored Normal file
View File

@ -0,0 +1,19 @@
name: commitlint
on:
pull_request_target:
types:
- opened
- reopened
jobs:
lint:
if: github.repository == 'frrouting/frr'
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Check Commit
uses: wagoid/commitlint-github-action@v5
with:
configFile: .github/commitlint.config.js

View File

@ -342,6 +342,46 @@ summary of the included patches. The description should provide
additional details that will help the reviewer to understand the context
of the included patches.
Squash commits
--------------
Before merging make sure a PR has squashed the following kinds of commits:
- Fixes/review feedback
- Typos
- Merges and rebases
- Work in progress
This helps to automatically generate human-readable changelog messages.
Commit Guidelines
-----------------
There is a built-in commit linter. Basic rules:
- Commit messages must be prefixed with the name of the changed subsystem, followed
by a colon and a space and start with an imperative verb.
`Check <https://github.com/FRRouting/frr/tree/master/.github/commitlint.config.js>`_ all
the supported subsystems.
- Commit messages must start with a capital letter
- Commit messages must not end with a period ``.``
Why was my pull request closed?
-------------------------------
Pull requests older than 180 days will be closed. Exceptions can be made for
pull requests that have active review comments, or that are awaiting other
dependent pull requests. Closed pull requests are easy to recreate, and little
work is lost by closing a pull request that subsequently needs to be reopened.
We want to limit the total number of pull requests in flight to:
- Maintain a clean project
- Remove old pull requests that would be difficult to rebase as the underlying code has changed over time
- Encourage code velocity
.. _license-for-contributions:
License for Contributions