Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add title-min-length rule #138

Closed
tjanez opened this issue Jul 21, 2020 · 2 comments
Closed

Add title-min-length rule #138

tjanez opened this issue Jul 21, 2020 · 2 comments
Labels
enhancement User-facing feature enhancements
Milestone

Comments

@tjanez
Copy link

tjanez commented Jul 21, 2020

It would be similar to the body-min-length rule and would quickly detect bad commit messages like "Fix", "Bump", ...

@jorisroovers
Copy link
Owner

Makes sense. Any thoughts on what the best default limitation should be?
This can be done purely by (configurable) char count - e.g. min 5 chars - or by needing at least 2 words.

I'm inclined to keep it simple to start and going for min 5 chars.

@jorisroovers jorisroovers added the enhancement User-facing feature enhancements label Aug 1, 2020
@tjanez
Copy link
Author

tjanez commented Aug 1, 2020

Any thoughts on what the best default limitation should be?
This can be done purely by (configurable) char count - e.g. min 5 chars - or by needing at least 2 words.

Hmm... I also though at doing char count first. At least 2 words probably also makes sense since I can't come up with a good one word commit message example 🙂.

I'm inclined to keep it simple to start and going for min 5 chars.

Yes, I think this would be a good start.

mrshu added a commit to mrshu/gitlint that referenced this issue Aug 8, 2020
* Add a new `title-min-length` rule which mimics the `body-min-length`
  rule in its function. The default min length is set to 5 as per the
  discussion in jorisroovers#138.

* Add a few tests modeled on TitleMaxLength.

Signed-off-by: mr.Shu <mr@shu.io>
mrshu added a commit to mrshu/gitlint that referenced this issue Aug 8, 2020
* Add a new `title-min-length` rule which mimics the `body-min-length`
  rule in its function. The default min length is set to 5 as per the
  discussion in jorisroovers#138.

* Add a few tests modeled on TitleMaxLength.

Signed-off-by: mr.Shu <mr@shu.io>
mrshu added a commit to mrshu/gitlint that referenced this issue Aug 8, 2020
* Add a new `title-min-length` rule which mimics the `body-min-length`
  rule in its function. The default min length is set to 5 as per the
  discussion in jorisroovers#138.

* Add a few tests modeled on TitleMaxLength.

Signed-off-by: mr.Shu <mr@shu.io>
mrshu added a commit to mrshu/gitlint that referenced this issue Aug 8, 2020
* Add a new `title-min-length` rule which mimics the `body-min-length`
  rule in its function. The default min length is set to 5 as per the
  discussion in jorisroovers#138.

* Add a few tests modeled on TitleMaxLength.

Signed-off-by: mr.Shu <mr@shu.io>
mrshu added a commit to mrshu/gitlint that referenced this issue Aug 8, 2020
* Add a new `title-min-length` rule which mimics the `body-min-length`
  rule in its function. The default min length is set to 5 as per the
  discussion in jorisroovers#138.

* Add a few tests modeled on TitleMaxLength.

Signed-off-by: mr.Shu <mr@shu.io>
mrshu added a commit to mrshu/gitlint that referenced this issue Aug 8, 2020
* Add a new `title-min-length` rule which mimics the `body-min-length`
  rule in its function. The default min length is set to 5 as per the
  discussion in jorisroovers#138.

* Add a few tests modeled on TitleMaxLength.

Signed-off-by: mr.Shu <mr@shu.io>
mrshu added a commit to mrshu/gitlint that referenced this issue Aug 8, 2020
* Add a new `title-min-length` rule which mimics the `body-min-length`
  rule in its function. The default min length is set to 5 as per the
  discussion in jorisroovers#138.

* Add a few tests modeled on TitleMaxLength.

Signed-off-by: mr.Shu <mr@shu.io>
@jorisroovers jorisroovers added this to the 0.14.0 milestone Oct 6, 2020
jorisroovers added a commit that referenced this issue Oct 24, 2020
- IMPORTANT: Gitlint 0.14.x will be the last gitlint release to support Python
  2.7 and Python 3.5, as both are EOL which makes it difficult to keep
  supporting them.
- Python 3.9 support
- New Rule: title-min-length enforces a minimum length on titles
  (default: 5 chars) (#138)
- New Rule: body-match-regex allows users to enforce that the commit-msg body
  matches a given regex (#130)
- New Rule: ignore-body-lines allows users to ignore parts of a commit by
  matching a regex against the lines in a commit message body (#126)
- Named Rules allow users to have multiple instances of the same rule active at
  the same time. This is useful when you want to enforce the same rule multiple
  times but with different options (#113, #66)
- User-defined Configuration Rules allow users to dynamically change gitlint's
  configuration and/or the commit before any other rules are applied.
- The commit-msg hook has been re-written in Python (it contained a lot of
  Bash before), fixing a number of platform specific issues. Existing users
  will need to reinstall their hooks
  (gitlint uninstall-hook; gitlint install-hook) to make use of this.
- Most general options can now be set through environment variables (e.g. set
  the general.ignore option via GITLINT_IGNORE=T1,T2). The list of available
  environment variables can be found in the configuration documentation.
- Users can now use self.log.debug("my message") for debugging purposes in
  their user-defined rules. Debug messages will show up when running
  gitlint --debug.
- Breaking: User-defined rule id's can no longer start with 'I', as those are
  reserved for built-in gitlint ignore rules.
- New RegexOption rule option type for use in user-defined rules. By using the
  RegexOption, regular expressions are pre-validated at gitlint startup and
  compiled only once which is much more efficient when linting multiple commits.
- Bugfixes:
 - Improved UTF-8 fallback on Windows (ongoing - #96)
 - Windows users can now use the 'edit' function of the commit-msg hook (#94)
 - Doc update: Users should use --ulimit nofile=1024 when invoking gitlint
   using Docker (#129)
 - The commit-msg hook was broken in Ubuntu's gitlint package due to a
   python/python3 mismatch (#127)
 - Better error message when no git username is set (#149)
 - Options can now actually be set to None (from code) to make them optional.
 - Ignore rules no longer have "None" as default regex, but an empty regex -
   effectively disabling them by default (as intended).
- Contrib Rules:
 - Added 'ci' and 'build' to conventional commit types (#135)
- Under-the-hood: minor performance improvements (removed some unnecessary
  regex matching), test improvements, improved debug logging, CI runs on pull
  requests, PR request template.

Full Release details in CHANGELOG.md.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement User-facing feature enhancements
Projects
None yet
Development

No branches or pull requests

2 participants