Skip to content

Commit

Permalink
Merge pull request #5 from Kristinita/SashaGoddess
Browse files Browse the repository at this point in the history
[Fixed] Percent symbol commentChar
  • Loading branch information
vovkkk authored Mar 26, 2017
2 parents ad93811 + c2217f0 commit d224108
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
28 changes: 14 additions & 14 deletions commit-message.YAML-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ uuid: BFE83C06-8508-44BE-A975-95A57BF619A7
patterns:
- comment: "Comments don't count when looking for the 'first line' of a commit."
name: comment.line.number-sign.git-commit
match: ^\s*(#).*$\n?
match: ^\s*([#|%]).*$\n?
captures:
'1': {name: punctuation.definition.comment.git-commit}

- include: '#diff'
- include: '[#|%]diff'

- comment: Capture the whole commit message to test the length of the first line.
NB the end pattern is just something to be never matched so the capture continues
Expand All @@ -26,59 +26,59 @@ patterns:
'2': { name: 'entity' }
'3': { name: invalid.deprecated.line-too-long.git-commit }
'4': { name: invalid.illegal.line-too-long.git-commit }
end: (?=^# \-+ \>8 \-+$)|(?=xxxxxx)123457
end: (?=^[#|%] \-+ \>8 \-+$)|(?=xxxxxx)123457
patterns:
- comment: capture the second line
begin: ^(()|(.*\s*))$
beginCaptures:
'3': { name: invalid.illegal.line-too-long.git-commit }
end: (?=^# \-+ \>8 \-+$)|(?=xxxxxx)123458
end: (?=^[#|%] \-+ \>8 \-+$)|(?=xxxxxx)123458
patterns:
- name: commit-text.git-commit
match: ^(?:(?!#))((.{0,72})(.*))$\n?
match: ^(?:(?![#|%]))((.{0,72})(.*))$\n?
captures:
'3': { name: invalid.illegal.line-too-long.git-commit }
# '4': { name: invalid.illegal.line-too-long.git-commit }
- name: comment.line.number-sign.git-commit
match: (^#)\sYour branch is up-to-date with '(.*)'.
match: (^[#|%])\sYour branch is up-to-date with '(.*)'.
captures:
'2': { name: constant.branch-name }
- name: comment.line.number-sign.git-commit
match: (^#)\s(On branch\s)(.*)$\n?
match: (^[#|%])\s(On branch\s)(.*)$\n?
captures:
'3': { name: constant.branch-name }
- name: comment.line.number-sign.git-commit
match: (^#)\s(.*:)$\n?
match: (^[#|%])\s(.*:)$\n?
captures:
'2': {name: punctuation.definition.comment.git-commit, name: storage}
- name: comment.line.number-sign.git-commit
match: (^#)\s*(modified:.*)$\n?
match: (^[#|%])\s*(modified:.*)$\n?
captures:
'1': {name: punctuation.definition.comment.git-commit}
'2': {name: markup.changed.git-commit}
- name: comment.line.number-sign.git-commit
match: (^#)\s*(renamed:)\s*(.*)\s*(->)\s*(.*)$\n?
match: (^[#|%])\s*(renamed:)\s*(.*)\s*(->)\s*(.*)$\n?
captures:
'1': {name: punctuation.definition.comment.git-commit}
'2': {name: markup.changed.git-commit}
'3': {name: markup.deleted.git-commit}
'4': {name: markup.changed.git-commit}
'5': {name: markup.inserted.git-commit}
- name: comment.line.number-sign.git-commit
match: (^#)\s*(new file:.*)$\n?
match: (^[#|%])\s*(new file:.*)$\n?
captures:
'1': {name: punctuation.definition.comment.git-commit}
'2': {name: markup.inserted.git-commit}
- name: comment.line.number-sign.git-commit
match: (^#)\s*(deleted:.*)$\n?
match: (^[#|%])\s*(deleted:.*)$\n?
captures:
'1': {name: punctuation.definition.comment.git-commit}
'2': {name: markup.deleted.git-commit}
- name: comment.line.number-sign.git-commit
match: ^\s*(#).*$\n?
match: ^\s*([#|%]).*$\n?
captures:
'1': {name: punctuation.definition.comment.git-commit}
- include: '#diff'
- include: '[#|%]diff'

repository:
diff:
Expand Down
28 changes: 14 additions & 14 deletions commit-message.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
<key>comment</key>
<string>Comments don't count when looking for the 'first line' of a commit.</string>
<key>match</key>
<string>^\s*(#).*$\n?</string>
<string>^\s*([#|%]).*$\n?</string>
<key>name</key>
<string>comment.line.number-sign.git-commit</string>
</dict>
<dict>
<key>include</key>
<string>#diff</string>
<string>[#|%]diff</string>
</dict>
<dict>
<key>begin</key>
Expand All @@ -58,7 +58,7 @@
<key>comment</key>
<string>Capture the whole commit message to test the length of the first line. NB the end pattern is just something to be never matched so the capture continues until the end of the file.</string>
<key>end</key>
<string>(?=^# \-+ \&gt;8 \-+$)|(?=xxxxxx)123457</string>
<string>(?=^[#|%] \-+ \&gt;8 \-+$)|(?=xxxxxx)123457</string>
<key>name</key>
<string>first-line.git-commit</string>
<key>patterns</key>
Expand All @@ -77,7 +77,7 @@
<key>comment</key>
<string>capture the second line</string>
<key>end</key>
<string>(?=^# \-+ \&gt;8 \-+$)|(?=xxxxxx)123458</string>
<string>(?=^[#|%] \-+ \&gt;8 \-+$)|(?=xxxxxx)123458</string>
<key>patterns</key>
<array>
<dict>
Expand All @@ -90,7 +90,7 @@
</dict>
</dict>
<key>match</key>
<string>^(?:(?!#))((.{0,72})(.*))$\n?</string>
<string>^(?:(?![#|%]))((.{0,72})(.*))$\n?</string>
<key>name</key>
<string>commit-text.git-commit</string>
</dict>
Expand All @@ -104,7 +104,7 @@
</dict>
</dict>
<key>match</key>
<string>(^#)\sYour branch is up-to-date with '(.*)'.</string>
<string>(^[#|%])\sYour branch is up-to-date with '(.*)'.</string>
<key>name</key>
<string>comment.line.number-sign.git-commit</string>
</dict>
Expand All @@ -118,7 +118,7 @@
</dict>
</dict>
<key>match</key>
<string>(^#)\s(On branch\s)(.*)$\n?</string>
<string>(^[#|%])\s(On branch\s)(.*)$\n?</string>
<key>name</key>
<string>comment.line.number-sign.git-commit</string>
</dict>
Expand All @@ -132,7 +132,7 @@
</dict>
</dict>
<key>match</key>
<string>(^#)\s(.*:)$\n?</string>
<string>(^[#|%])\s(.*:)$\n?</string>
<key>name</key>
<string>comment.line.number-sign.git-commit</string>
</dict>
Expand All @@ -151,7 +151,7 @@
</dict>
</dict>
<key>match</key>
<string>(^#)\s*(modified:.*)$\n?</string>
<string>(^[#|%])\s*(modified:.*)$\n?</string>
<key>name</key>
<string>comment.line.number-sign.git-commit</string>
</dict>
Expand Down Expand Up @@ -185,7 +185,7 @@
</dict>
</dict>
<key>match</key>
<string>(^#)\s*(renamed:)\s*(.*)\s*(-&gt;)\s*(.*)$\n?</string>
<string>(^[#|%])\s*(renamed:)\s*(.*)\s*(-&gt;)\s*(.*)$\n?</string>
<key>name</key>
<string>comment.line.number-sign.git-commit</string>
</dict>
Expand All @@ -204,7 +204,7 @@
</dict>
</dict>
<key>match</key>
<string>(^#)\s*(new file:.*)$\n?</string>
<string>(^[#|%])\s*(new file:.*)$\n?</string>
<key>name</key>
<string>comment.line.number-sign.git-commit</string>
</dict>
Expand All @@ -223,7 +223,7 @@
</dict>
</dict>
<key>match</key>
<string>(^#)\s*(deleted:.*)$\n?</string>
<string>(^[#|%])\s*(deleted:.*)$\n?</string>
<key>name</key>
<string>comment.line.number-sign.git-commit</string>
</dict>
Expand All @@ -237,13 +237,13 @@
</dict>
</dict>
<key>match</key>
<string>^\s*(#).*$\n?</string>
<string>^\s*([#|%]).*$\n?</string>
<key>name</key>
<string>comment.line.number-sign.git-commit</string>
</dict>
<dict>
<key>include</key>
<string>#diff</string>
<string>[#|%]diff</string>
</dict>
</array>
</dict>
Expand Down

0 comments on commit d224108

Please sign in to comment.