Skip to content

Commit

Permalink
fix: subject and summary should be allowed to have 1 char (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
gbprod authored Mar 14, 2024
1 parent 2474065 commit 523a1a4
Show file tree
Hide file tree
Showing 5 changed files with 34,617 additions and 29,335 deletions.
13 changes: 13 additions & 0 deletions corpus/body.txt
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,16 @@ This is a simple body
(message
(overflow)))

================================================================================
Allows 1 char summary
================================================================================
This is a simple subject

T
--------------------------------------------------------------------------------

(source
(subject)
(message))


17 changes: 14 additions & 3 deletions corpus/subject.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ This should not exists
--------------------------------------------------------------------------------

(source
(subject)
(ERROR))
(ERROR
(subject))
(subject))

================================================================================
Subject with type and scope
Expand Down Expand Up @@ -157,7 +158,7 @@ feat(issue42): allow numbers in scope

(source
(subject))

================================================================================
Parse fixup!
================================================================================
Expand Down Expand Up @@ -223,3 +224,13 @@ feat(hi):some message
(prefix
(type)
(scope))))

================================================================================
Allows 1 char subject
================================================================================
o

--------------------------------------------------------------------------------

(source
(subject))
4 changes: 2 additions & 2 deletions grammar.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const NEWLINE = /\r?\n/;
const ANYTHING = /[^\n\r]+/;
const SUBJECT = /[^\n\r]{1,49}/;
const SUBJECT = /[^\n\r]{0,49}/;
const NOT_A_COMMENT = /[^#]/;
const SUMMARY = /[^\n\r]{1,72}/;
const SUMMARY = /[^\n\r]{0,72}/;
const SCISSORS = /# -+ >8 -+\r?\n/;
const BRANCH_NAME = /[^\s'”»"“]+/;
const COMMIT = /[0-9a-f]{7,40}/;
Expand Down
4 changes: 2 additions & 2 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
},
{
"type": "PATTERN",
"value": "[^\\n\\r]{1,49}"
"value": "[^\\n\\r]{0,49}"
}
]
},
Expand Down Expand Up @@ -289,7 +289,7 @@
},
{
"type": "PATTERN",
"value": "[^\\n\\r]{1,72}"
"value": "[^\\n\\r]{0,72}"
}
]
},
Expand Down
Loading

0 comments on commit 523a1a4

Please sign in to comment.