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(core): add sentence-case to ensure-case #117

Merged
merged 3 commits into from
Nov 18, 2017
Merged

feat(core): add sentence-case to ensure-case #117

merged 3 commits into from
Nov 18, 2017

Conversation

Rugal
Copy link
Contributor

@Rugal Rugal commented Nov 14, 2017

  1. Add standard-case rule
  2. Add test cases

@marionebl
Copy link
Contributor

marionebl commented Nov 16, 2017

Thanks for the contribution!

If I understand this correctly you want to enable the use case raised as being unsupported in #114, where one wants to check if the first letter of the subject is capitalized or not, e.g.

# config: [2, 'never']
# subject-case: [0]
echo "type: Foo Bar" | commitlint # throws for new rule
echo "type: foo Bar" | commitlint # passes 
echo "type: foo bar" | commitlint # passes

# config: ['2', 'never']
# subject-case: [2, 'always', 'lowercase']
echo "type: Foo Bar" | commitlint # throws for new rule, subject-case
echo "type: foo Bar" | commitlint # throws
echo "type: foo bar" | commitlint # passes

# config: ['2', 'always']
# subject-case: [2, 'always', 'lowercase']
echo "type: Foo Bar" | commitlint # throws for subject-case
echo "type: foo Bar" | commitlint # throws for subject-case
echo "type: foo bar" | commitlint # passes

I'd prefer to put this into a distinct rule named subject-leading-case, what do you think?

@Rugal
Copy link
Contributor Author

Rugal commented Nov 16, 2017

Hi @marionebl,

Thanks for the reply.

Actually I have this requirement from myself, where I want to have the first letter of a capture group to be uppercase. This not only applies for subject, but also for the others, like type, scope etc.

With that said, making it a rule that different from the xxx-case rule might cause collision.
For instance, I specify subject-case = lowercase and subject-leading-case = uppercase, which would be problematic, hence, I think it is better to create a case rather than a separate rule.

What's your opinion?

@marionebl
Copy link
Contributor

Ok, I can follow your reasoning here - avoiding the complexity of handling the collision of *-case vs. *-leading-case is a good thing.

Do you have a reference for calling this standard-case?

I'd lean towards renaming this to sentence-case:
https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage

Also, it would be awesome if you could extend the rule docs accordingly to your changes.

@Rugal
Copy link
Contributor Author

Rugal commented Nov 17, 2017

Awesome, I am good with the renaming.
I will rename it to sentence-case and add some docs.

@Rugal
Copy link
Contributor Author

Rugal commented Nov 17, 2017

@marionebl Please rerun appveyor CI.

@marionebl marionebl changed the title feat(core): add standard-case rule feat(core): add sentence-case rule Nov 18, 2017
@marionebl marionebl changed the title feat(core): add sentence-case rule feat(core): add sentence-case to ensure-case Nov 18, 2017
@marionebl marionebl merged commit 41749bc into conventional-changelog:master Nov 18, 2017
@Rugal Rugal deleted the StandardCase branch November 18, 2017 17:54
@@ -156,6 +157,7 @@ Rule configurations are either of type `array` residing on a key with the rule's
'camel-case', // camelCase
'kebab-case', // kebab-case
'pascal-case', // PascalCase
'sentence-case', // Sentence case
Copy link
Contributor Author

@Rugal Rugal Nov 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marionebl This duplicates the docs I added, please see 3 lines below.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, deduped it

bpedersen pushed a commit to bpedersen/commitlint that referenced this pull request Oct 15, 2019
…-changelog#100 (conventional-changelog#117)

* chore: refactoring version page

* refactor: migrate version page to hooks

* refactor: Version page better imports

* fix: conventional-changelog#100 render not found on click item

* test: add test for version page

* chore: update mocks

* test: add scenario for not found package

* chore: fix wrong mock path

* chore: update mock

* chore: add todo list
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.

None yet

2 participants