From bdefe9452c5065eb854c41a68bc5ed1fffb33958 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Tue, 14 May 2024 19:35:19 +0200 Subject: [PATCH] .github: revise and update contributing guidelines Signed-off-by: Joachim Wiberg --- .github/CONTRIBUTING.md | 56 ++++++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index ec606cae..7be095a3 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -11,7 +11,7 @@ Talking about code and problems first is often the best way to get started before submitting a pull request. When submitting a bug report, patch, or pull request, please start by -stating the version the change is made against, what it does, and why. +stating the version the change is made against, what it does, *and why*. Please take care to ensure you follow the project coding style and the commit message format. If you follow these recommendations you help @@ -21,13 +21,28 @@ the maintainer(s) and make it easier for them to include your code. Coding Style ------------ -> **Tip:** Always submit code that follows the style of surrounding code! +Before jumping into code, remember to **document new features** and bug +fixes. Both the manual and ChangeLog are in the `doc/` sub-directory +and it is expected that you provide a human-readable summary for the +release notes (ChangeLog) and at least a configuration example in the +manual for new features. -First of all, lines are allowed to be longer than 72 characters these -days. In fact, there exist no enforced maximum, but keeping it around -100 chars is OK. +> **Tip:** consider ["Readme driven development"][RDD] for new features. +> It is amazing how many flaws in your own bright ideas come to bare +> when you suddenly have to explain them to someone else! -The coding style itself is otherwise strictly Linux [KNF][]. +We expect code contributions for: + + - C code in [Linux Coding Style][Linux] + - Python code should follow [PEP-8][] + +> **However,** always submit code that follows the style of surrounding +> code! Legacy takes precedence, and remember, we read code a lot more +> than write it, so legibility is important. + +As a final note, lines are allowed to be longer than 72 characters these +days. There is no enforced maximum, but the team usually keep it around +100 characters for both C and Python. Commit Messages @@ -37,22 +52,21 @@ Commit messages exist to track *why* a change was made. Try to be as clear and concise as possible in your commit messages, and always, be proud of your work and set up a proper GIT identity for your commits: - git config --global user.name "Jane Doe" - git config --global user.email jane.doe@example.com + $ git config --global user.name "Jacky Linker" + $ git config --global user.email jacky.linker@example.com Example commit message from the [Pro Git][gitbook] online book, notice how `git commit -s` is used to automatically add a `Signed-off-by`: - Brief, but clear and concise summary of changes + subsystem: brief, but clear and concise summary of changes More detailed explanatory text, if necessary. Wrap it to about 72 characters or so. In some contexts, the first line is treated as the subject of an email and the rest of the text as the body. The - blank line separating the ummary from the body is critical (unless - you omit the body entirely); tools like rebase can get confused if - you run the two together. + empty line separating summary from body is critical. Tools like + rebase can get confused if the empty line is missing. - Further paragraphs come after blank lines. + Further paragraphs should be separated with empty lines. - Bullet points are okay, too @@ -60,17 +74,19 @@ how `git commit -s` is used to automatically add a `Signed-off-by`: by a single space, with blank lines in between, but conventions vary here - Signed-off-by: Jane Doe + Signed-off-by: Jacky Linker Code of Conduct --------------- It is expected of everyone to respect the [Code of Conduct][conduct]. -The *"maintainers have the right and responsibility to remove, edit, -or reject comments, commits, code, wiki edits, issues, and other -contributions that are not aligned to this Code of Conduct."* +The *"maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, discussion forum threads, issues, and +other contributions that are not aligned to this Code of Conduct."* -[KNF]: https://en.wikipedia.org/wiki/Kernel_Normal_Form -[gitbook]: https://git-scm.com/book/ch5-2.html -[conduct]: CODE-OF-CONDUCT.md +[Linux]: https://www.kernel.org/doc/html/v6.9/process/coding-style.html +[PEP-8]: https://peps.python.org/pep-0008/ +[RDD]: https://tom.preston-werner.com/2010/08/23/readme-driven-development +[gitbook]: https://git-scm.com/book/ch5-2.html +[conduct]: CODE-OF-CONDUCT.md