Add better support for footer issue references
See original GitHub issueCurrently, when autocompleting a footer token, a colon is always added. While this is the desired behavior in most cases, the conventional commit specification states that this should not be done, if followed by an issue reference, e.g. Closes #123
:
Each footer MUST consist of a word token, followed by either a
:<space>
or<space>#
separator, followed by a string value (this is inspired by the git trailer convention).
~ Conventional Commit Spec, Point 8
Possible Implementation
First of all, when linting the commit message, a warning should be shown, if the footer’s value starts with “: #
”. This could be paired with the option to auto-fix this, depending on whether the footer’s value is an issue reference or plain text, to remove the colon or the '#`, respectively.
Additionally, an “issue reference” option could be added to the footer types settings. This should be turned on for Closes
, Implements
, and Refs
. If turned on, " #
" will be inserted after the token, instead of ":
". This should cover most cases, as issue refs are mostly used for those three.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:12 (7 by maintainers)
Top GitHub Comments
The lexer now works correctly with both cases. This issue will be closed when a completion contributor based on the PSI structure is implemented, potentially in 0.22.0.
No, not at all. Take any time you need.