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

Fix/numeric subject case #451

Merged
merged 2 commits into from
Oct 5, 2018
Merged

Fix/numeric subject case #451

merged 2 commits into from
Oct 5, 2018

Conversation

byCedric
Copy link
Member

@byCedric byCedric commented Oct 3, 2018

Description

This fixes #438

Motivation and Context

I've added edge case-ignores to both @commitlint/rules's subject-case rule as well as @commitlint/ensure's case. The reason for putting ignores in 2 places are these.

  1. You said that we should ignore all characters not matching /^[a-z]/i from the case rules in general.
    This was my initial thought of putting an ignore/exception into the /ensure package. Unfortunately, this conflicted with the test of LOWERCASE (with backtick), so I had to change it to ignore /^[0-9]/.

  2. In the subject case you can negate the rule
    Due to the negation happening in the /rules package, and not /ensure, I had to also include the ignore here. I've tested it with both the !a-z as well as 0-9 ignore pattern, and here we actually could use the !a-z exclusion rule.

  • subjectCase('1.0.0', 'never', 'lowercase') === true
  • subjectCase('1.0.0', 'always', 'lowercase') === true

Usage examples

$ printf "chore(release): 1.0.1 [skip ci]\n\n## [1.0.1](https://github.com/xmlking/ngx-starter-kit/compare/v1.0.0...v1.0.1) (2018-09-09)\n\n\n### Bug Fixes\n\n* **build:** now updating version ([2d913ea](https://github.com/xmlking/ngx-s
tarter-kit/commit/2d913ea))\n\n\n\n" | npx commitlint -x '@commitlint/config-conventional'

How Has This Been Tested?

See motivation & context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@marionebl
Copy link
Contributor

Thanks! <3

@marionebl marionebl merged commit cadcfed into conventional-changelog:master Oct 5, 2018
@byCedric byCedric deleted the fix/numeric-subject-case branch October 5, 2018 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Valid commit message subject is rejected
2 participants