Skip to content

Commit

Permalink
Revert "feat: add warning on subject overflow (#52)" (#57)
Browse files Browse the repository at this point in the history
This reverts commit 7fe4245.
  • Loading branch information
gbprod authored Feb 29, 2024
1 parent 7fe4245 commit 8230d6b
Show file tree
Hide file tree
Showing 8 changed files with 34,364 additions and 34,584 deletions.
20 changes: 4 additions & 16 deletions corpus/subject.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,26 +65,14 @@ Empty file w/ empty comment
================================================================================
Subject overflow
================================================================================
this is a subject with an overflow, it's longer than 50 characters
this is a simple subject with an awesome overflow because it's longer than 50 characters

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

(source
(subject
(overflow)))

================================================================================
Subject overflow and warning
================================================================================
this is a simple subject with an awesome overflow because it's longer than 72 characters

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

(source
(subject
(overflow
(warning))))

================================================================================
Not a comment
================================================================================
Expand All @@ -104,8 +92,8 @@ This should not exists
--------------------------------------------------------------------------------

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

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

(source
(subject))

================================================================================
Parse fixup!
================================================================================
Expand Down
5 changes: 1 addition & 4 deletions grammar.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const NEWLINE = /\r?\n/;
const ANYTHING = /[^\n\r]+/;
const SUBJECT = /[^\n\r]{1,49}/;
const OVERFLOW = /[^\n\r]{1,22}/;
const NOT_A_COMMENT = /[^#]/;
const SCISSORS = /# -+ >8 -+\r?\n/;
const BRANCH_NAME = /[^\s'»"]+/;
Expand Down Expand Up @@ -42,11 +41,9 @@ module.exports = grammar({
seq(NOT_A_COMMENT, SUBJECT),
seq($.prefix, $._conventional_subject)
),
optional($.overflow)
optional(alias(ANYTHING, $.overflow))
),

overflow: ($) => seq(OVERFLOW, optional(alias(ANYTHING, $.warning))),

prefix: ($) =>
seq(
alias($._conventional_type, $.type),
Expand Down
2 changes: 1 addition & 1 deletion queries/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

(subject) @text.title
(subject (overflow) @text)
(subject (overflow (warning) @text.warning))
(prefix (type) @keyword)
(prefix (scope) @parameter)
(prefix [
Expand All @@ -32,3 +31,4 @@
(scissor) @comment
(subject_prefix) @keyword

(ERROR) @error
23 changes: 1 addition & 22 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,27 +168,6 @@
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "overflow"
},
{
"type": "BLANK"
}
]
}
]
},
"overflow": {
"type": "SEQ",
"members": [
{
"type": "PATTERN",
"value": "[^\\n\\r]{1,22}"
},
{
"type": "CHOICE",
"members": [
Expand All @@ -199,7 +178,7 @@
"value": "[^\\n\\r]+"
},
"named": true,
"value": "warning"
"value": "overflow"
},
{
"type": "BLANK"
Expand Down
23 changes: 4 additions & 19 deletions src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,21 +170,6 @@
"named": true,
"fields": {}
},
{
"type": "overflow",
"named": true,
"fields": {},
"children": {
"multiple": false,
"required": false,
"types": [
{
"type": "warning",
"named": true
}
]
}
},
{
"type": "prefix",
"named": true,
Expand Down Expand Up @@ -1003,6 +988,10 @@
"type": "ny fil:",
"named": false
},
{
"type": "overflow",
"named": true
},
{
"type": "pick",
"named": false
Expand Down Expand Up @@ -1135,10 +1124,6 @@
"type": "value",
"named": true
},
{
"type": "warning",
"named": true
},
{
"type": "yeni dosya:",
"named": false
Expand Down
Loading

0 comments on commit 8230d6b

Please sign in to comment.