Replies: 4 comments 1 reply
-
Thanks for the write up, I am in favor of this! |
Beta Was this translation helpful? Give feedback.
-
PR titles should have type and scope and details about breaking change. This PR title should be the commit message when the PR gets merged to master (it's already this way). |
Beta Was this translation helpful? Give feedback.
-
Here's a simplified version of types and scopes: Types:
Scopes:There is no strict list of scopes to be used, suggested scopes are:
|
Beta Was this translation helpful? Give feedback.
-
#2645 - documenting convention in contributing docs |
Beta Was this translation helpful? Give feedback.
-
Conventional Commits:
Currently there is no rules about commit messages in this repo, while some people are using
conventional commits approach https://www.conventionalcommits.org/en/v1.0.0/
This proposal is to establish a convention for commit messages to keep them more organized.
The goal here is to help maintainers to navigate commits and help developers to write better
commit messages.
There is no goal to generate changelogs from the commit messages (at the moment).
Base format:
Types:
feat
- new feature/functionalityit's recommended to link a GH issue or discussion which describes the feature request
or describe it in the commit message
fix
- bugfixit's recommended to link a GH issue or discussion to describe the bug
or describe it in the commit message
refactor
- code restructure/refactor which does not affect the (public) behaviourstyle
- formatting, adding newlines, etc. in coderefactor
typedocs
- changes in documentationtest
- adding, improving, removing testsbuild
- changes to build scripts, dockerfiles, ci pipelinesdeps
- updates to dependencies configurationbuild
typechore
- none of the aboveuse in generally discuraged
revert
- revert previous commitWe can add more types for example if we see a lot of
chore
type usage.Scopes:
Scope is optional and used in tools like dependabot,
there is no strict set of scopes but here are some examples:
build(ci)
- changes in github workflowdeps(go)
- dependabot updating go librarydocs(examples)
- changes in examplesfeat(kanctl)
- new functionality forkanctl
(e.g. new command)Breaking changes indicator:
You can use
!
after the type and scope to indicate breaking changesfix(scope)!: fix with breaking changes
Description:
Short description of WHAT was changed in the commit.
SHOULD start with lowercase.
MUST NOT have a
.
at the end.Body:
Body should contain a description of changes and importantly reasoning
behind the changes, it may include links to issues or discussions, but should
be sufficient to understand WHY the commit is there.
May also contain some information about WHAT was changes if description did not fit all of it.
Footer:
In order to indicate breaking changes in the commit message you can use
BREAKING CHANGES:
footer, listing breaking changes, e.g.Tools for validation:
Here are some tools which can be used to validate if commit format matches the spec:
Both can be configured with specific types and scopes
Both can be set up to run on pre-commit hooks
There are some others as well out there.
Flow
We can install one of the tools in the build image and run hooks using docker
to avoid install requirements.
How it could work is:
make commitlint
command which runs the tool for HEAD commit (or on the parameter)commit-msg
hook orpost-commit
hook (provided instructions) to run the commit lint when committingOn github side:
Beta Was this translation helpful? Give feedback.
All reactions