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(main): add custom scope prompt #20

Closed
wants to merge 1 commit into from
Closed

feat(main): add custom scope prompt #20

wants to merge 1 commit into from

Conversation

Todomir
Copy link

@Todomir Todomir commented Mar 27, 2023

I think we should be able to add an custom scope when it is enabled. Right now I'm just injecting an extra option with the value of "custom", but maybe this could be enabled via config.

@Everduin94
Copy link
Owner

Do you have a real-world example of this in mind?

Since scope is optional. I can't really think of a scenario where someone would add a custom scope 1 time that wouldn't be useful to be used again, or by another developer. i.e. if none of the existing scopes are applicable, and it doesn't make sense to add the new one to the config, you would usually just omit scope altogether.

If there are good examples or others might find it useful I don't have a problem adding it.

@Todomir
Copy link
Author

Todomir commented Mar 28, 2023

Usually, I use custom scopes when targeting specific files or folders that are nested in other folders so that it is clear on the commit what was changed. Maybe it is not compliant with the Conventional Commits spec, but it is an use case. Also, if you have a lot of scopes it can be a hassle to find them in the list, so typing could be an alternative.

Everduin94 added a commit that referenced this pull request Mar 28, 2023
Added a config custom_scope default: false to add an option that prompts for a custom scope

Refs: #20
@Everduin94
Copy link
Owner

@Todomir - Makes sense.

Ideally for long scope lists we need the upstream to add this: "List Search" bombshell-dev/clack#35

I've added custom scope as default false. A few things on my PR that led me to create a new one:

  • Handled by config
  • Passed through ZOD object, otherwise intial_value: "custom" would have failed
  • Added to documentation
  • Removed validate since scope is optional and the commit builder handles empty gracefully.

See: #21

@Everduin94 Everduin94 closed this Mar 28, 2023
Everduin94 added a commit that referenced this pull request Mar 28, 2023
Added a config custom_scope default: false to add an option that prompts for a custom scope

Refs: #20
@Todomir
Copy link
Author

Todomir commented Mar 28, 2023

Yeah, list search feature benefit the package a lot. I usually work with an Gitmoji + Convetional hybrid and Gitmoji has way more prefixes than Conventional. Searching would be superb

github-actions bot pushed a commit that referenced this pull request Apr 12, 2023
# 1.0.0 (2023-04-12)

### Bug Fixes

* **main:** Fixed undefined when ticket is empty ([#13](#13)) ([80e819a](80e819a))
* **tools:** Replace git branch get name method ([#5](#5)) ([12feba8](12feba8))

* Merge pull request from Everduin94/everduin94/feat/1-improve-docs ([13bb314](13bb314)), closes [#1](#1) [#1](#1)
* feat(tools)!: #1 This is an example commit ([6342aca](6342aca)), closes [#1](#1) [#1](#1)

### Features

* **main:** [#10](#10) add hints to default types ([#11](#11)) ([ae97cd1](ae97cd1))
* **main:** [#14](#14) print commit output ([#15](#15)) ([86cbf0c](86cbf0c))
* **main:** Add "chore" type to defaults ([#18](#18)) ([396b985](396b985))
* **main:** add license and minor fixes ([#25](#25)) ([62deffb](62deffb)), closes [#22](#22) [#23](#23) [#24](#24)
* **main:** custom scope prompt ([#21](#21)) ([858cce7](858cce7)), closes [#20](#20)
* **main:** testing github action ([0c3a08a](0c3a08a))
* **main:** testing github action ([04966a3](04966a3))
* **main:** testing github workflow ([4baca59](4baca59))
* **tools:** [#3](#3) infer ticket/issue from branch ([#4](#4)) ([bae6601](bae6601))
* **tools:** added custom footer option ([#9](#9)) ([1df1d82](1df1d82))
* **tools:** Initial commit of better-commits to public repository ([21aa536](21aa536))

### BREAKING CHANGES

* Fake breaking change

Making a fake breaking change as an example
* Fake breaking change

Making a fake breaking change as an example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants