Skip to content

Instantly share code, notes, and snippets.

@G00fY2
Created April 14, 2021 22:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save G00fY2/c8daab6115c07d78d8851565bf703375 to your computer and use it in GitHub Desktop.
Save G00fY2/c8daab6115c07d78d8851565bf703375 to your computer and use it in GitHub Desktop.
kotlin conventional commit
val conventionalCommitRegex = Regex("^((build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\\(\\w+\\))?(!)?(: (.*\\s*)*))|(Merge (.*\\s*)*)|(Initial commit\$)")
val maxSubjectLineLength = 72
val test = "fix(dagger): fix bad injection"
conventionalCommitRegex.matches(test) && test.lines().first().length <= maxSubjectLineLength
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment