Skip to content

Commit

Permalink
chore: add branch name validation
Browse files Browse the repository at this point in the history
  • Loading branch information
stardustmeg committed Aug 13, 2024
1 parent 4e73d98 commit 3063e26
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx validate-branch-name
2 changes: 1 addition & 1 deletion .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"*": ["prettier --write --ignore-unknown"],
"*.{cjs,js,mjs,jsx,ts,tsx}": ["eslint --max-warnings 0"],
"*.{js,mjs,jsx,ts,tsx}": ["eslint --max-warnings 0"],
"*.scss": "npx stylelint --fix"
}
9 changes: 9 additions & 0 deletions .validate-branch-namerc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
pattern: /^(feat|fix|hotfix|chore|refactor|revert|docs|style|test|)\/tu-0[1-3]-\d{2}\/[a-zA-Z0-9-]+$/,
errorMsg: 'Please use correct branch name',
};

// Branch Name Examples:

// "feat/tu-01-01/add-login-form" // where 01 is the sprint number and 01 is the issue number
// "fix/tu-02-03/fix-router" // where 02 is the sprint number and 03 is the issue number
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"stylelint-config-standard": "^36.0.1",
"stylelint-config-standard-scss": "^13.1.0",
"stylelint-order": "^6.0.4",
"typescript": "^5.5.4"
"typescript": "^5.5.4",
"validate-branch-name": "^1.3.1"
}
}

0 comments on commit 3063e26

Please sign in to comment.