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

feat(rules): support array for scope-case and type-case #312

Conversation

SimeonC
Copy link
Contributor

@SimeonC SimeonC commented Mar 27, 2018

Description

I've changed the scope-case and type-case rules to follow the same option for providing arrays in the rule value as is used in subject-case. Additionally, I've added tests to all 3 rules to check for this use case.

Motivation and Context

As outlined in #307 it's really useful to be able to use a mixture of scope casing types when you use file/folder names as the scope.

Usage examples

This is my specific use case.

// commitlint.config.js
module.exports = {
  extends: ['@commitlint/config-conventional'],
  rules: {
    'scope-case': [2, 'always', ['camel-case', 'pascal-case', 'lower-case']]
  }
};
echo "fix(someFunctionUtil): " | commitlint # passes
echo "fix(ReactComponent): " | commitlint # passes
echo "fix(ERROR): " | commitlint # fails

How Has This Been Tested?

Added test suites that passed under subject-case, then copy/tweaked them to the other files to check that they all worked in the same way.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My change requires a change to the documentation. (Does this need documentation? or is the subject-case docs missing this feature?)
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

As per issue conventional-changelog#307 port the logic from subject-case for array definitions over to scope-case and type-case.
@SimeonC
Copy link
Contributor Author

SimeonC commented Apr 5, 2018

@marionebl sorry to bug you, any chance of getting this merged/reviewed anytime soon?

@marionebl
Copy link
Contributor

Will have a look at this tomorrow, thanks for your patience!

@marceloavf
Copy link

@SimeonC I don't think you need to update documentation since it already show an example with array

@marionebl
Copy link
Contributor

Thanks for your patience people, merging this.

@marionebl marionebl merged commit 1f46b9f into conventional-changelog:master May 1, 2018
@marionebl
Copy link
Contributor

Released via 6.2.0

@SimeonC SimeonC deleted the add-array-check-to-scope-case branch May 2, 2018 01:20
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.

3 participants