33This is a set of [ ` pre-commit ` ] hooks for development across multiple languages.
44
55Hooks:
6- * ` todo-tagged-jira ` : ensure all TODO comments reference a JIRA ticket
6+ * ` todo-tags ` : ensure all TODO comments reference a JIRA ticket (or any regex matcher)
77* ` todo-branch-tags ` : show all TODOs tagged with the ticket reference in the branch name
88* ` branch-name-check ` : checks branch names adhere to the regex ` ^(feature|bugfix|release|hotfix)\/.+ `
99* ` go-test ` : runs ` go test ./... ` at the repo root
@@ -24,9 +24,10 @@ repos:
2424 - repo : https://github.com/domodwyer/pre-commit
2525 rev : master
2626 hooks :
27- - id : todo-tagged-jira # Requires python
27+ - id : todo-tags # Requires python
2828 stages : [commit, push, manual]
2929 args : ["--tag=DEV"] # JIRA ticket tag (defaults to DEV)
30+ # args: ["--regex='.*'"] # Or specify your own regex
3031
3132 - id : todo-branch-tags
3233 stages : [post-checkout, manual] # Show tags when checking out
@@ -79,10 +80,19 @@ repos:
7980New TODOs introduced into the codebase should be tracked in JIRA so they're
8081eventually done!
8182
82- The ` todo-tagged-jira` hook searches changed files for `TODO` comments (lines
83- prefixed by `#` or `//`) that do not reference a JIRA ticket. A valid TODO is in
84- the form : ` TODO(DEV-4242)` , where the `DEV` tag is configurable, and `4242` is
85- the ticket number.
83+ The ` todo-tags` hook searches changed files for `TODO` comments (lines prefixed
84+ by `#` or `//`) that do not reference a JIRA ticket. A valid TODO is in the
85+ form : ` TODO(DEV-4242)` , where the `DEV` tag is configurable, and `4242` is the
86+ ticket number.
87+
88+ Instead for more flexibility, you can specify a custom regex to validate TODO
89+ tags with instead :
90+
91+ ` ` ` yaml
92+ - id: todo-tags
93+ stages: [commit, push, manual]
94+ args: ["--regex='(dom|clive)'"]
95+ ` ` `
8696
8797The `todo-branch-tags` is useful as a [`post-checkout`] hook to print all TODOs
8898tagged with the ticket reference in the branch name. If you checkout a branch
0 commit comments