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(config): Add allowed_scopes #402

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

TjazVracko
Copy link
Contributor

@TjazVracko TjazVracko commented Oct 14, 2024

Hi,

This PR adds support for allowed_scopes. It functions the same way as allowed_types, except that the default list is empty, which means that all scopes are allowed.

I hope the changes follow the expectations of this repo.
I am unsure about the changes I made to CHANGELOG.md and toreference.md and the commit message itself.

Details

This feature can be used by adding allowed_scopes to the config file:

allowed_scopes = ["list", "of", "allowed", "scopes"]

When using a scope not in the list, the following error is printed:

Disallowed scope `wrong` used, please use one of ["list", "of", "allowed", "scopes"]

Notes

Issue #7 mentions a scope "blacklist" as well. I thought about adding a disallowed_scopes config as well, but It seems like added complexity at this point. If you have both allowed and disallowed lists, you probably need to check that only one of them is present in the config at the same time + maybe other things I have not thought of.

If a feature for disallowed_scopes is also needed, I might code it up in the future if I have the time. But I feel like allowed_scopes can stand on its own.

Resolves #7

@coveralls
Copy link

Pull Request Test Coverage Report for Build 11333675108

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 23 (0.0%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.3%) to 5.24%

Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/committed/src/config.rs 0 9 0.0%
crates/committed/src/checks.rs 0 14 0.0%
Files with Coverage Reduction New Missed Lines %
crates/committed/src/config.rs 1 0.0%
Totals Coverage Status
Change from base Build 11128006904: -0.3%
Covered Lines: 24
Relevant Lines: 458

💛 - Coveralls

@epage
Copy link
Collaborator

epage commented Oct 30, 2024

Thanks!

@epage epage merged commit 3727279 into crate-ci:master Oct 30, 2024
17 checks passed
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.

Have Conventional scope whitelist/blacklist
3 participants