Skip to content

Commit

Permalink
feat: ✨ added support for fixup! & match! comments
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Feb 24, 2021
1 parent 79cb9cf commit 155dee2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions __tests__/lint.ts
Expand Up @@ -3,6 +3,9 @@ import { Cli } from "../src/cli"
test("should", async () => {
const cli = await Cli.create(["", ""], true)
const valid = `style: 🎨 prettier 2.0
fixup! foo
squash!
revert something
Merge branch 'master' of github.com:folke/devmoji
style: 🎨 Prettier 2.0
chore(release): 2.1.8 [skip ci]
Expand Down
2 changes: 2 additions & 0 deletions src/cli.ts
Expand Up @@ -19,6 +19,8 @@ export class Cli {
lint(text: string) {
text = text.split("\n")[0]
if (text.startsWith("Merge branch")) return []
if (/^(fixup|squash)!/.test(text)) return []
if (/^([rR]evert)/.test(text)) return []

const errors = []
const match = /^(?<type>:?[a-z-]+)(?:\((?<scope>[a-z-]+)\))?(!?):\s+(?<description>.*)/iu.exec(
Expand Down

0 comments on commit 155dee2

Please sign in to comment.