Skip to content

Commit ecc48ce

Browse files
committed
style: start using conventional commits
1 parent db292d4 commit ecc48ce

File tree

2 files changed

+46
-19
lines changed

2 files changed

+46
-19
lines changed

CONTRIBUTING.md

+45-18
Original file line numberDiff line numberDiff line change
@@ -20,38 +20,65 @@ All well-intentioned, polite, and respectful contributions are always welcome! T
2020
## Commit messages
2121

2222
- Try to make commit message as concise as possible while giving enough information about nature of a change. Think about whether it will be easy to understand in one year time when browsing through commit history.
23-
- Use two part structure:
24-
- First part is a change overview in present tense, preferably in single line under 80 characters. Should end with a period. Usually should be enough.
2523

26-
**If commit affects only one particular module (as it usually should), prepend with "(mini.\<module-name\>) ".** If commit ensures something for all modules but not necessary touches all of them, use "(all) ".
24+
- Single commit should change either zero or one module, or affect all modules (i.e. enforcing some universal rule but not necessarily change files). Changes for two or more modules should be split in several module-specific commits.
25+
26+
- Use [Conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) style:
27+
- Messages should follow the following structure:
28+
29+
```
30+
<type>[optional scope][!]: <description>
31+
<empty line>
32+
[optional body]
33+
<empty line>
34+
[optional footer(s)]
35+
```
36+
37+
- `<type>` is **mandatory** and can be one of:
38+
- `ci` - change in how automation (Github actions, dual distribution scripts, etc.) is done.
39+
- `docs` - change in user-facing documentation (help, README, CONTRIBUTING, etc.).
40+
- `feat` - adding new user-facing feature.
41+
- `fix` - resolving user-facing issue.
42+
- `refactor` - change in code or documentation that should not affect users.
43+
- `style` - change in convention of how something should be done (formatting, wording, etc.) and its effects.
44+
- `test` - change in tests.
45+
For temporary commits which later should be squashed (when working on PR, for example), use `fixup` type.
46+
- `[optional scope]`, if present, should be done in parenthesis `()`. If commit changes single module (as it usually should), using scope with module name is **mandatory**. If commit enforces something for all modules, use `ALL` scope.
47+
- Breaking change, if present, should be expressed with `!` before `:`.
48+
- `<description>` is a change overview in imperative, present tense ("change" not "changed" nor "changes"). Should result into first line under 72 characters. Should start with not capitalized word and NOT end with punctuation.
49+
- `[optional body]`, if present, should contain details and motivation about the change in plain language. Should be formatted to have maximum 80 characters in line.
50+
- `[optional footer(s)]`, if present, should be instructions to Git or Github. Use "Resolve #xxx" as separate entry if this commit resolves issue or PR.
2751

28-
- Second part is optional and should contain details about the change after empty line and "Details:". Use bullet list with `-`.
52+
- Use module's function and field names without module's name. Like `add()` and not `MiniSurround.add()`.
2953

30-
Use "Resolves #xxx" as separate entry if this commit resolves issue or PR.
54+
Examples:
3155

32-
- Use these prefixes after initial module name in described situations:
33-
- "FEATURE:" - if change implements new feature (like option or function).
34-
- "BREAKING:" - if change breaks current documented behavior.
35-
- "BREAKING FEATURE:" - if change introduces new feature while breaking current documented behavior.
36-
- "NEW MODULE:" - if change introduces new module (see 'MAINTAINING.md').
56+
```
57+
feat(deps): add folds in update confirmation buffer
58+
```
3759

38-
- Use module's function and field names without module's name. Like `add()` and not `MiniSurround.add()`.
60+
```
61+
fix(jump): make operator not delete one character if target is not found
3962
40-
Examples:
63+
One main goal is to do that in a dot-repeatable way, because this is very
64+
likely to be repeated after an unfortunate first try.
4165
66+
Resolve #688
4267
```
43-
Fix typo in 'README.md'.
68+
4469
```
70+
refactor(bracketed): do not source 'vim.treesitter' on `require()`
4571
72+
Although less explicit, this considerably reduces startup footprint of
73+
'mini.bracketed' in isolation.
4674
```
47-
(mini.animate) Update `cursor` to use virtual columns.
4875

49-
Details:
50-
- Resolves #258.
76+
```
77+
feat(hues)!: update verbatim text to be distinctive
5178
```
5279

5380
```
54-
(mini.comment) FEATURE: add `options.pad_comment_leaders` option.
81+
test(ALL): update screenshots to work on Nightly
5582
```
5683

5784
## Generating help file
@@ -76,7 +103,7 @@ If you have Windows or MacOS and want to contribute code related change, make yo
76103

77104
This project uses [StyLua](https://github.com/JohnnyMorganz/StyLua) version 0.14.0 for formatting Lua code. Before making changes to code, please:
78105

79-
- [Install StyLua](https://github.com/JohnnyMorganz/StyLua#installation). NOTE: use `v0.14.0`.
106+
- [Install StyLua](https://github.com/JohnnyMorganz/StyLua#installation). NOTE: use `v0.19.0`.
80107
- Format with it. Currently there are two ways to do this:
81108
- Manually run `stylua .` from the root directory of this project.
82109
- [Install pre-commit](https://pre-commit.com/#install) and enable it with `pre-commit install` (from the root directory). This will auto-format relevant code before making commits.

MAINTAINING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Usual workflow involves performing these steps after every commit in 'mini.nvim'
5656
- Update main README to mention new module in table of contents.
5757
- Update 'CHANGELOG.md' to mention introduction of new module.
5858
- Update 'CONTRIBUTING.md' to mention new highlight groups (if there are any).
59-
- Commit changes with message '(mini.xxx) NEW MODULE: initial commit.'. NOTE: it is cleaner to synchronize standalone repositories prior to this commit.
59+
- Commit changes with message 'feat(xxx): add NEW MODULE'. NOTE: it is cleaner to synchronize standalone repositories prior to this commit.
6060
- If there are new highlight groups, follow up with adding explicit support in color scheme modules.
6161
- Make standalone plugin:
6262
- Create new empty GitHub repository. Disable Issues and limit PRs.

0 commit comments

Comments
 (0)