Skip to content

Commit 8230d6b

Browse files
authored
Revert "feat: add warning on subject overflow (#52)" (#57)
This reverts commit 7fe4245.
1 parent 7fe4245 commit 8230d6b

File tree

8 files changed

+34364
-34584
lines changed

8 files changed

+34364
-34584
lines changed

corpus/subject.txt

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,26 +65,14 @@ Empty file w/ empty comment
6565
================================================================================
6666
Subject overflow
6767
================================================================================
68-
this is a subject with an overflow, it's longer than 50 characters
68+
this is a simple subject with an awesome overflow because it's longer than 50 characters
6969

7070
--------------------------------------------------------------------------------
7171

7272
(source
7373
(subject
7474
(overflow)))
7575

76-
================================================================================
77-
Subject overflow and warning
78-
================================================================================
79-
this is a simple subject with an awesome overflow because it's longer than 72 characters
80-
81-
--------------------------------------------------------------------------------
82-
83-
(source
84-
(subject
85-
(overflow
86-
(warning))))
87-
8876
================================================================================
8977
Not a comment
9078
================================================================================
@@ -104,8 +92,8 @@ This should not exists
10492
--------------------------------------------------------------------------------
10593

10694
(source
107-
(subject)
108-
(ERROR))
95+
(subject)
96+
(ERROR))
10997

11098
================================================================================
11199
Subject with type and scope
@@ -169,7 +157,7 @@ feat(issue42): allow numbers in scope
169157

170158
(source
171159
(subject))
172-
160+
173161
================================================================================
174162
Parse fixup!
175163
================================================================================

grammar.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
const NEWLINE = /\r?\n/;
22
const ANYTHING = /[^\n\r]+/;
33
const SUBJECT = /[^\n\r]{1,49}/;
4-
const OVERFLOW = /[^\n\r]{1,22}/;
54
const NOT_A_COMMENT = /[^#]/;
65
const SCISSORS = /# -+ >8 -+\r?\n/;
76
const BRANCH_NAME = /[^\s'»"]+/;
@@ -42,11 +41,9 @@ module.exports = grammar({
4241
seq(NOT_A_COMMENT, SUBJECT),
4342
seq($.prefix, $._conventional_subject)
4443
),
45-
optional($.overflow)
44+
optional(alias(ANYTHING, $.overflow))
4645
),
4746

48-
overflow: ($) => seq(OVERFLOW, optional(alias(ANYTHING, $.warning))),
49-
5047
prefix: ($) =>
5148
seq(
5249
alias($._conventional_type, $.type),

queries/highlights.scm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
(subject) @text.title
1111
(subject (overflow) @text)
12-
(subject (overflow (warning) @text.warning))
1312
(prefix (type) @keyword)
1413
(prefix (scope) @parameter)
1514
(prefix [
@@ -32,3 +31,4 @@
3231
(scissor) @comment
3332
(subject_prefix) @keyword
3433

34+
(ERROR) @error

src/grammar.json

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -168,27 +168,6 @@
168168
}
169169
]
170170
},
171-
{
172-
"type": "CHOICE",
173-
"members": [
174-
{
175-
"type": "SYMBOL",
176-
"name": "overflow"
177-
},
178-
{
179-
"type": "BLANK"
180-
}
181-
]
182-
}
183-
]
184-
},
185-
"overflow": {
186-
"type": "SEQ",
187-
"members": [
188-
{
189-
"type": "PATTERN",
190-
"value": "[^\\n\\r]{1,22}"
191-
},
192171
{
193172
"type": "CHOICE",
194173
"members": [
@@ -199,7 +178,7 @@
199178
"value": "[^\\n\\r]+"
200179
},
201180
"named": true,
202-
"value": "warning"
181+
"value": "overflow"
203182
},
204183
{
205184
"type": "BLANK"

src/node-types.json

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -170,21 +170,6 @@
170170
"named": true,
171171
"fields": {}
172172
},
173-
{
174-
"type": "overflow",
175-
"named": true,
176-
"fields": {},
177-
"children": {
178-
"multiple": false,
179-
"required": false,
180-
"types": [
181-
{
182-
"type": "warning",
183-
"named": true
184-
}
185-
]
186-
}
187-
},
188173
{
189174
"type": "prefix",
190175
"named": true,
@@ -1003,6 +988,10 @@
1003988
"type": "ny fil:",
1004989
"named": false
1005990
},
991+
{
992+
"type": "overflow",
993+
"named": true
994+
},
1006995
{
1007996
"type": "pick",
1008997
"named": false
@@ -1135,10 +1124,6 @@
11351124
"type": "value",
11361125
"named": true
11371126
},
1138-
{
1139-
"type": "warning",
1140-
"named": true
1141-
},
11421127
{
11431128
"type": "yeni dosya:",
11441129
"named": false

0 commit comments

Comments
 (0)