Skip to content

fix(rules): do not negate case rules #330

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

Merged

Conversation

JLHwung
Copy link
Contributor

@JLHwung JLHwung commented May 7, 2018

Description

Change subject-case rule on config-conventional and config-angular to non-negating rules.

Motivation and Context

Many scripts, i.e. Han, Devanagari, are not cased. Thus ensureCase will always return true for texts written in these scripts on any case rules.

Negating case rules will cause test: 你好 as invalid since they are conformed to any case rules.

For definition of cased, see http://unicode.org/reports/tr44/#Cased

Usage examples

// commitlint.config.js
module.exports = {

};
echo "your commit message here" | commitlint # fails/passes

How Has This Been Tested?

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.

Further plans for discussion

Deprecate the use of never on case rules as

  • there exists many scripts not cased
  • Better warnings on casing policy when commit messages fails. Think about comparing

subject must not be sentence-case, start-case, pascal-case, upper-case [subject-case]

with

subject must be lower-case, kebab-case, camel-case, snake-case [subject-case]

Many scripts, i.e. Han, Devanagari, are not cased. Thus `ensureCase` will always return true for texts written in these scripts on any case rules.

Negating case rules will cause `test: 你好` as invalid since they are conformed to any case rules.

For definition of cased, see http://unicode.org/reports/tr44/#Cased
@JLHwung JLHwung force-pushed the never-negate-case-rules branch from e0238b1 to b61adf1 Compare May 7, 2018 03:03
@marionebl marionebl merged commit 996deb3 into conventional-changelog:master Jun 2, 2018
@marionebl
Copy link
Contributor

Thank you. <3

marionebl added a commit that referenced this pull request Jun 2, 2018
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.

2 participants