-
Notifications
You must be signed in to change notification settings - Fork 21
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
fix: Use correct error message when regex validation fails #55
Open
al
wants to merge
1
commit into
barzik:main
Choose a base branch
from
al:fix/regex-validation-error-message
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Use `msgDoesNotMatchRegex` rather than `msgBranchDisallowed` when the branch name does not pass the regex validation.
al
added a commit
to al/lionels-legacy
that referenced
this pull request
Jul 23, 2024
Add branch-name-lint to enforce a Git branch naming convention. Add a Husky pre-push hook to run the linter before pushing a branch. To manually run the linter: pnpm run lint:branch Branches must consist of a valid prefix (see below), a forward-slash (`/`), and a name that begins with a letter and contains only letters, digits, hyphens (`-`) and periods (`.`). E.g. `feat/implement-thing`. Valid branch prefixes are: - `chore` For miscellaneous changes that do not fall into any other category. - `ci` For changes to CI configuration files and scripts. - `core` For change to build processes, tooling, dependencies or general project structure. - `doc` For changes to documentation. - `experiment` For temporary experiments/spikes. These branches will not be merged. - `feat` For new features. - `fix` For bug fixes. - `hotfix` For critical bug fixes that will need to be merged directly into the production environment. - `release` For preparing releases to production. - `test` For changes to tests. The (case-insensitive) validation regex is: ^([a-z]+/[a-z][a-z0-9\-\.]*) NOTES: - Using a fork of the official branch-name-lint repo in which we have implemented our own fix for misleading error messages (barzik/branch-name-lint#55) and merged a community fix for general mishandling of errors (barzik/branch-name-lint#45). LINKS: - https://github.com/barzik/branch-name-lint - https://github.com/al/branch-name-lint/tree/integration/error-handling-issues
al
added a commit
to al/lionels-legacy
that referenced
this pull request
Jul 23, 2024
Add branch-name-lint to enforce a Git branch naming convention. Add a Husky pre-push hook to run the linter before pushing a branch. To manually run the linter: pnpm run lint:branch Branches must consist of a valid prefix (see below), a forward-slash (`/`), and a name that begins with a letter and contains only letters, digits, hyphens (`-`) and periods (`.`). E.g. `feat/implement-thing`. Valid branch prefixes are: - `chore` For miscellaneous changes that do not fall into any other category. - `ci` For changes to CI configuration files and scripts. - `core` For change to build processes, tooling, dependencies or general project structure. - `doc` For changes to documentation. - `experiment` For temporary experiments/spikes. These branches will not be merged. - `feat` For new features. - `fix` For bug fixes. - `hotfix` For critical bug fixes that will need to be merged directly into the production environment. - `release` For preparing releases to production. - `test` For changes to tests. The (case-insensitive) validation regex is: ^[a-z]+/[a-z][a-z0-9.-]*$ NOTES: - Using a fork of the official branch-name-lint repo in which we have implemented our own fix for misleading error messages (barzik/branch-name-lint#55) and merged a community fix for general mishandling of errors (barzik/branch-name-lint#45). LINKS: - https://github.com/barzik/branch-name-lint - https://github.com/al/branch-name-lint/tree/integration/error-handling-issues
al
added a commit
to al/lionels-legacy
that referenced
this pull request
Jul 23, 2024
Add branch-name-lint to enforce a Git branch naming convention. Add a Husky pre-push hook to run the linter before pushing a branch. To manually run the linter: pnpm run lint:branch Branches must consist of a valid prefix (see below), a forward-slash (`/`), and a name that begins with a letter and contains only letters, digits, hyphens (`-`) and periods (`.`). E.g. `feat/implement-thing`. Valid branch prefixes are: - `chore` For miscellaneous changes that do not fall into any other category. - `ci` For changes to CI configuration files and scripts. - `core` For changes to build processes, tooling, dependencies or general project structure. - `doc` For changes to documentation. - `experiment` For temporary experiments/spikes. These branches will not be merged. - `feat` For new features. - `fix` For bug fixes. - `hotfix` For critical bug fixes that will need to be merged directly into the production environment. - `release` For preparing releases to production. - `test` For changes to tests. The (case-insensitive) validation regex is: ^[a-z]+/[a-z][a-z0-9.-]*$ NOTES: - Using a fork of the official branch-name-lint repo in which we have implemented our own fix for misleading error messages (barzik/branch-name-lint#55) and merged a community fix for general mishandling of errors (barzik/branch-name-lint#45). LINKS: - https://github.com/barzik/branch-name-lint - https://github.com/al/branch-name-lint/tree/integration/error-handling-issues
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Use
msgDoesNotMatchRegex
rather thanmsgBranchDisallowed
when the branch name does not pass the regex validation.