forked from hinterland/documentation
5.7 KiB
5.7 KiB
Contribution conventions
Branch conventions
<type>/<subject>[/<subsubject>, ...]
<type>
This should be one of:
featureFor work on a feature, look atfeatcommit type description for further info.fixFor fixing a but in a feature, look atfixcommit type descriptionrefactorLook atrefactorcommit type descriptionhotfixTemporary quick fixes of critical errors to masterreleasePre-release finalization changes
Examples:
feature/note_preview- working on featurenote_previewinsrc/feature/note_previewdirectoryfeature/note_graph/note_graph_ui- working of submodulenote_graph_uiof modulenote_graphinsrc/feature/note_graphdirectoryfix/configuration- fixing how configuration works (it was doing unwraps/expects, rewrite it to returningResults, which is breaking API change and technically crash fix so not refactor, and not a feature because nothing new was added)- This is now the branch that addedfeature/graph-traitsrc/lib/graph.rswas named. At first i was thinking that it is hard to fit such a fundamental thing to the feature model, but it's not that fundamental.
It's primarily a part ofnote_graphfeature, and so ones like this should be named feature-first, not library-first.
Most of the time if you adding something you add it for some feature. If most of your work in this branch is a library, for example a force-directed placement implementation or a environment variable substitution parser, it is still done first for some feature, specificallynote_graphand accordinglyconfigurationin that case.
<subject>
This should be one of, in priority order:
feature/module name that you're currently working on- meaningful short description or a naming for your scope, separated with dashes (
-), one or a couple of words
<subsubject>
This should be one of, in priority order:
feature/submodule, likenote_graph/note_graph_ui- meaningful short description or a naming for your scope, separated with dashes (
-), one or a couple of words
Commit conventions
Pull requests
For pull request merges, use the default message, which is Merge pull request #N from <branch-name>
Follow
Merges
Don't use merges for your own local things. Use rebases.
Merge branch '<branch name>'
Follows default git merge message
TODO: maybe rebase all the history to be the above with some changes to it (it has to have the pull request number in it)
Default
The format is:
<type>[(<scope>)][!]: <subject>
[<body>]
[<footers>]
Including the empty lines
!
- This means that this commit introduces a breaking change.
<type>
Specify one or more types, separated by commas, to reflect the nature of the changes.
- Allowed types:
featCommits, that adds a new feature or changes how the old feature works. Should only be user-presented features, changes to logic that does not affect what user of the app sees isrefactor.fixCommits, that fix a bugrefactorCommits, that rewrite/restructure your code, however does not change any behaviourperfCommits are specialrefactorcommits, that improve performance
styleCommits, that do not affect the meaning (white-space, formatting, missing semi-colons, etc)testCommits, that add missing tests or correcting existing testsdocsCommits, that affect documentation onlybuildCommits, that affect build components like build tool, dependencies, project version, ...ciCommits, that affect the CI pipelinechoreMiscellaneous commits e.g. modifying.gitignorerevertCommits that revert other commits
- Myltiple Types:
- When a commit involves multiple types, list them separated by commas within
{}braces.
- When a commit involves multiple types, list them separated by commas within
<scope>
This should be one of, in priority order:
feature/module name that you're currently working on- meaningful short description or a naming for your scope, separated with dashes (
-), one or a couple of words
Examples:
- (authentication)
- (feature/note_graph,note_graph_ui)
- (api,user-management)
<subject>
- Use the imperative, present tense: "change" not "changed", "add" not "added"
- Don't capitalize the first letter
- No dot (.) at the end
<body>
- Use the imperative, present tense: "change" not "changed", "add" not "added"
- This is the place to mention issue identifiers and their relations
<footers>
List of format:
<subject>: <description>
BREAKING CHANGE: <description>Same as the!, but with description. Can't be included without the!.- Mention closed issues
- Example:
Closes: #1
- Example:
- Stuff like skip CI for tools like Github Actions
Examples
Single Type Commit
feat(configuration): add support for environment variables
Allows users to define configuration using environment variables.
Closes: #42
Multiple Types Commit
{build,fix}(deployment): fix Dockerfile and update dependencies
- Fixed a typo in the Dockerfile causing build failures.
- Updated dependencies to the latest versions.
Closes: #101
Single Type Commit
refactor!(api): change authentication method to OAuth2
Switched from basic authentication to OAuth2 for enhanced security.
BREAKING CHANGE: The authentication method has changed from basic auth to OAuth2. Clients must update their authentication mechanism.
Closes: #202
Single Type Commit
{docs,test}(feature/note_graph,note_graph_ui): add tests and update documentation
- Added unit tests for note graph UI components.
- Updated the README with new setup instructions.
Related: #303