Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat grammar warnings as non-fatal #5497

Merged
merged 13 commits into from
Aug 3, 2021
Merged

Conversation

lildude
Copy link
Member

@lildude lildude commented Aug 3, 2021

Description

We have a very long list of outstanding grammar issues in #3924 which isn't getting much smaller, mostly because of the number of non-fatal issues that really aren't much of an issue. This output is what is produced when I update the grammars with each release and it makes it really hard to spot new legitimate issues.

This PR addresses one of @Alhadis's longest requests:

Could we downgrade "Missing include in grammar:… the scope cannot be found" errors to build-time warnings, please?

If a contributor attempts to add or replace a grammar with legitimate errors, they get a failure as before:

Example output for adding/replacing grammar with fatal errors
$ script/add-grammar --replace turtle.tmbundle https://github.com/peta/turtle.tmbundle
Checking docker is installed and running
$ docker ps
Deregistering: vendor/grammars/turtle.tmbundle
$ git submodule deinit vendor/grammars/turtle.tmbundle
$ git rm -rf vendor/grammars/turtle.tmbundle
$ script/grammar-compiler update -f
Registering new submodule: vendor/grammars/turtle.tmbundle
$ git submodule add -f https://github.com/peta/turtle.tmbundle vendor/grammars/turtle.tmbundle
$ script/grammar-compiler add vendor/grammars/turtle.tmbundle
  > 
  > 5 errors found in new grammar 'repository `vendor/grammars/turtle.tmbundle` (from https://github.com/peta/turtle.tmbundle)':
  > - Invalid regex in grammar: `source.turtle` (in `Syntaxes/Turtle.tmLanguage`) contains a malformed regex (regex "`(?x)                          (?<PNAME_NS> (?: (?: [\`...": PCRE does not support \L, \l, \N{name}, \U, or \u (at offset 68))
  > - Invalid regex in grammar: `source.turtle` (in `Syntaxes/Turtle.tmLanguage`) contains a malformed regex (regex "`(?x)((?<=\s|^|_)(?:[\p{L}\p{M}] `...": PCRE does not support \L, \l, \N{name}, \U, or \u (at offset 57))
  > - Invalid regex in grammar: `source.turtle` (in `Syntaxes/Turtle.tmLanguage`) contains a malformed regex (regex "`(?x)                  (?<PN_CHARS_U>[\p{L}\p{M`...": PCRE does not support \L, \l, \N{name}, \U, or \u (at offset 73))
  > - Invalid regex in grammar: `source.turtle` (in `Syntaxes/Turtle.tmLanguage`) contains a malformed regex (regex "`\[[\u20\u9\uD\uA]*\]`": PCRE does not support \L, \l, \N{name}, \U, or \u (at offset 4))
  > - Invalid regex in grammar: `source.turtle` (in `Syntaxes/Turtle.tmLanguage`) contains a malformed regex (regex "`(?x)(                         (?: [\p{L}\p{M}] | [:0`...": PCRE does not support \L, \l, \N{name}, \U, or \u (at offset 121))
  > 
  > Compilation failed. Aborting

$

If they attempt to add or replace a grammar with only warnings, they don't get a failure, but they do get a warning:

Example output for adding/replacing grammar with non-fatal warnings
$ script/add-grammar --replace vscode-lean https://github.com/leanprover/vscode-lean
Checking docker is installed and running
$ docker ps
Deregistering: vendor/grammars/vscode-lean
$ git submodule deinit vendor/grammars/vscode-lean
$ git rm -rf vendor/grammars/vscode-lean
$ script/grammar-compiler update -f
Registering new submodule: vendor/grammars/vscode-lean
$ git submodule add -f https://github.com/leanprover/vscode-lean vendor/grammars/vscode-lean
$ script/grammar-compiler add vendor/grammars/vscode-lean
  > 7 warnings found when compiling new grammar 'repository `vendor/grammars/vscode-lean` (from https://github.com/leanprover/vscode-lean)':
  > - Unknown keys in grammar: `source.lean.markdown` (in `syntaxes/lean-markdown.json`) contains invalid keys (`Repository[lists].Patterns[0].why`, `Repository[lists].Patterns[1].why`, `Repository[raw_block_disabled].why`, `information_for_contributors`, `version`)
  > - Missing include in grammar: `source.lean.markdown` (in `syntaxes/lean-markdown.json`) attempts to include `text.html.derivative` but the scope cannot be found
  > - Missing include in grammar: `source.lean.markdown` (in `syntaxes/lean-markdown.json`) attempts to include `source.json.comments` but the scope cannot be found
  > - Missing include in grammar: `source.lean.markdown` (in `syntaxes/lean-markdown.json`) attempts to include `source.asp.vb.net` but the scope cannot be found
  > - Missing include in grammar: `source.lean.markdown` (in `syntaxes/lean-markdown.json`) attempts to include `text.git-commit` but the scope cannot be found
  > - Missing include in grammar: `source.lean.markdown` (in `syntaxes/lean-markdown.json`) attempts to include `text.git-rebase` but the scope cannot be found
  > - Missing include in grammar: `source.lean.markdown` (in `syntaxes/lean-markdown.json`) attempts to include `text.log` but the scope cannot be found
  > 
  > These warnings are not fatal, but may mean the syntax highlighting on GitHub.com may not be as expected.
  > 
Caching grammar license
$ bundle exec licensed cache -c vendor/licenses/config.yml
Updating grammar documentation in vendor/README.md
$ bundle exec rake samples
$ script/sort-submodules
$ script/list-grammars

$

I've also hidden these warnings by default when updating/compiling all the grammars:

Example output for updating/compiling all grammars
$ script/grammar-compiler update -f
 378 / 378  100.00% 5m36s
done! processed 378 grammars

- [ ] repository `vendor/grammars/abap.tmbundle` (from https://github.com/pvl/abap.tmbundle) (1 errors)
  - Invalid regex in grammar: `source.abap` (in `Syntaxes/ABAP.tmLanguage`) contains a malformed regex (regex "`(?i)(?<=(?:^|\s|~|->|-|=>))([a-z`...": lookbehind assertion is not fixed length (at offset 26))

- [ ] repository `vendor/grammars/atom-language-perl6` (from https://github.com/perl6/atom-language-perl6) (6 errors)
  - Invalid regex in grammar: `source.raku` (in `grammars/raku.cson`) contains a malformed regex (regex "`(?x) ( [\p{Digit}\p{Alpha}'\-_]+`...": unknown property name after \P or \p (at offset 16))
  - Invalid regex in grammar: `source.raku` (in `grammars/raku.cson`) contains a malformed regex (regex "`[\p{Digit}\p{Alpha}'\-_]+`": unknown property name after \P or \p (at offset 9))
  - Invalid regex in grammar: `source.raku` (in `grammars/raku.cson`) contains a malformed regex (regex "`(?x)(\$|@|%|&)(\.|\*|:|!|\^|~|`...": unknown property name after \P or \p (at offset 57))
  - Invalid regex in grammar: `source.raku` (in `grammars/raku.cson`) contains a malformed regex (regex "`(?x)(?<!\\)(\$|@|%|&)(?!\$)(`...": unknown property name after \P or \p (at offset 75))
  - Invalid regex in grammar: `source.raku` (in `grammars/raku.cson`) contains a malformed regex (regex "`(`": missing ) (at offset 1))
  - Invalid regex in grammar: `source.raku` (in `grammars/raku.cson`) contains a malformed regex (regex "`)`": unmatched parentheses (at offset 0))

- [ ] repository `vendor/grammars/c.tmbundle` (from https://github.com/textmate/c.tmbundle) (4 errors)
  - Invalid regex in grammar: `source.c.platform` (in `Syntaxes/Platform.tmLanguage`) contains a malformed regex (regex "`\b(?:A(?:APNot(?:CreatedErr|Foun`...": definition too long (282084 bytes))
  - Invalid regex in grammar: `source.c.platform` (in `Syntaxes/Platform.tmLanguage`) contains a malformed regex (regex "`\b(?:A(?:E(?:A(?:ddressDesc|rray`...": definition too long (52248 bytes))
  - Invalid regex in grammar: `source.c.platform` (in `Syntaxes/Platform.tmLanguage`) contains a malformed regex (regex "`\b(?:CATransform3DIdentity|KERNE`...": definition too long (33340 bytes))
  - Invalid regex in grammar: `source.c.platform` (in `Syntaxes/Platform.tmLanguage`) contains a malformed regex (regex "`(\s*)(\b(?:A(?:E(?:Build(?:Apple`...": definition too long (58589 bytes))

- [ ] repository `vendor/grammars/gap-tmbundle` (from https://github.com/dhowden/gap-tmbundle) (3 errors)
  - Invalid regex in grammar: `source.gap` (in `Syntaxes/GAP.tmLanguage`) contains a malformed regex (regex "`\b(16Bits_AssocWord|16Bits_Depth`...": definition too long (65523 bytes))
  - Invalid regex in grammar: `source.gap` (in `Syntaxes/GAP.tmLanguage`) contains a malformed regex (regex "`\b(IndicesChiefNormalSteps|Indic`...": definition too long (65529 bytes))
  - Invalid regex in grammar: `source.gap` (in `Syntaxes/GAP.tmLanguage`) contains a malformed regex (regex "`\b(SMTX_GoodElementGModule|SMTX_`...": definition too long (42470 bytes))

- [ ] repository `vendor/grammars/language-jsonnet` (from https://github.com/google/language-jsonnet) (1 errors)
  - Invalid regex in grammar: `source.jsonnet` (in `grammars/jsonnet.cson`) contains a malformed regex (regex "`\b[a-zA-Z_][a-z0-9A-Z_]*\s*(\([^`...": nothing to repeat (at offset 43))

- [ ] repository `vendor/grammars/mathematica-tmbundle` (from https://github.com/shadanan/mathematica-tmbundle) (1 errors)
  - Invalid regex in grammar: `source.mathematica` (in `Syntaxes/Mathematica.tmLanguage`) contains a malformed regex (regex "`(\b|(?<=_))(Abort|AbortKernels|A`...": definition too long (54020 bytes))

- [ ] repository `vendor/grammars/objective-c.tmbundle` (from https://github.com/textmate/objective-c.tmbundle) (2 errors)
  - Invalid regex in grammar: `source.objc.platform` (in `Syntaxes/Platform.tmLanguage`) contains a malformed regex (regex "`\b(?:AB(?:AddRecordsError|Multip`...": definition too long (32854 bytes))
  - Invalid regex in grammar: `source.objc.platform` (in `Syntaxes/Platform.tmLanguage`) contains a malformed regex (regex "`\b(?:A(?:M(?:Action(?:A(?:pplica`...": definition too long (44404 bytes))

- [ ] repository `vendor/grammars/sublime-autoit` (from https://github.com/AutoIt/SublimeAutoItScript) (2 errors)
  - Invalid regex in grammar: `source.autoit` (in `AutoIt.tmLanguage`) contains a malformed regex (regex "`\b(?i:_array1dtohistogram|_array`...": definition too long (39591 bytes))
  - Invalid regex in grammar: `source.autoit` (in `AutoIt.tmLanguage`) contains a malformed regex (regex "`\b(?i:_guictrltoolbar_getbuttoni`...": definition too long (39600 bytes))

- [ ] repository `vendor/grammars/turtle.tmbundle` (from https://github.com/peta/turtle.tmbundle) (5 errors)
  - Invalid regex in grammar: `source.turtle` (in `Syntaxes/Turtle.tmLanguage`) contains a malformed regex (regex "`(?x)  (?<PNAME_NS> (?: (?: [\`...": PCRE does not support \L, \l, \N{name}, \U, or \u (at offset 68))
  - Invalid regex in grammar: `source.turtle` (in `Syntaxes/Turtle.tmLanguage`) contains a malformed regex (regex "`(?x)( (?: [\p{L}\p{M}] | [:0`...": PCRE does not support \L, \l, \N{name}, \U, or \u (at offset 121))
  - Invalid regex in grammar: `source.turtle` (in `Syntaxes/Turtle.tmLanguage`) contains a malformed regex (regex "`(?x)  (?<PN_CHARS_U>[\p{L}\p{M`...": PCRE does not support \L, \l, \N{name}, \U, or \u (at offset 73))
  - Invalid regex in grammar: `source.turtle` (in `Syntaxes/Turtle.tmLanguage`) contains a malformed regex (regex "`(?x)((?<=\s|^|_)(?:[\p{L}\p{M}] `...": PCRE does not support \L, \l, \N{name}, \U, or \u (at offset 57))
  - Invalid regex in grammar: `source.turtle` (in `Syntaxes/Turtle.tmLanguage`) contains a malformed regex (regex "`\[[\u20\u9\uD\uA]*\]`": PCRE does not support \L, \l, \N{name}, \U, or \u (at offset 4))

The grammar library contains 25 errors

$

This smaller output will be what is used to continue to track problems with the grammars in #3924 .

These warnings can however be revealed with the -v flag:

Example verbose output for updating/compiling all grammars
$ script/grammar-compiler update -f -v
 378 / 378  100.00% 3m56s
done! processed 378 grammars

- [ ] repository `vendor/grammars/NimLime` (from https://github.com/nim-lang/NimLime) (2 errors)
  - Missing include in grammar: `source.nim` (in `Syntaxes/Nim.tmLanguage`) attempts to include `source.asm` but the scope cannot be found
  - Missing include in grammar: `source.nim` (in `Syntaxes/Nim.tmLanguage`) attempts to include `text.html.markdown.multimarkdown` but the scope cannot be found

- [ ] repository `vendor/grammars/Scalate.tmbundle` (from https://github.com/scalate/Scalate.tmbundle) (1 errors)
  - Missing include in grammar: `source.scaml` (in `Syntaxes/Scaml.tmLanguage`) attempts to include `source.js.jquery` but the scope cannot be found

- [ ] repository `vendor/grammars/Sublime-SQF-Language` (from https://github.com/JonBons/Sublime-SQF-Language) (1 errors)
  - Unknown keys in grammar: `source.sqf` (in `SQF.tmLanguage`) contains invalid keys (`Patterns[20].block`)

- [ ] repository `vendor/grammars/SystemVerilog` (from https://github.com/TheClams/SystemVerilog) (1 errors)
  - Unknown keys in grammar: `source.systemverilog` (in `SystemVerilog.tmLanguage`) contains invalid keys (`hidden`)

- [ ] repository `vendor/grammars/abap.tmbundle` (from https://github.com/pvl/abap.tmbundle) (1 errors)
  - Invalid regex in grammar: `source.abap` (in `Syntaxes/ABAP.tmLanguage`) contains a malformed regex (regex "`(?i)(?<=(?:^|\s|~|->|-|=>))([a-z`...": lookbehind assertion is not fixed length (at offset 26))

- [ ] repository `vendor/grammars/astro` (from https://github.com/snowpackjs/astro) (7 errors)
  - Unknown keys in grammar: `text.html.markdown.astro` (in `tools/vscode/syntaxes/astro-markdown.tmLanguage.json`) contains invalid keys (`information_for_contributors`)
  - Unknown keys in grammar: `text.html.astro` (in `tools/vscode/syntaxes/astro.tmLanguage.json`) contains invalid keys (`Patterns[9].Patterns[1].Patterns[0].__DEFAULT_STYLE_INCLUDE_END__`, `Patterns[9].Patterns[1].Patterns[0].__DEFAULT_STYLE_INCLUDE_START__`, `Patterns[9].__DEFAULT_STYLE_NAME_END__`, `Patterns[9].__DEFAULT_STYLE_NAME_START__`)
  - Missing include in grammar: `text.html.markdown.astro` (in `tools/vscode/syntaxes/astro-markdown.tmLanguage.json`) attempts to include `source.json.comments` but the scope cannot be found
  - Missing include in grammar: `text.html.markdown.astro` (in `tools/vscode/syntaxes/astro-markdown.tmLanguage.json`) attempts to include `text.git-commit` but the scope cannot be found
  - Missing include in grammar: `text.html.markdown.astro` (in `tools/vscode/syntaxes/astro-markdown.tmLanguage.json`) attempts to include `text.git-rebase` but the scope cannot be found
  - Missing include in grammar: `text.html.markdown.astro` (in `tools/vscode/syntaxes/astro-markdown.tmLanguage.json`) attempts to include `text.log` but the scope cannot be found
  - Missing include in grammar: `text.html.markdown.astro` (in `tools/vscode/syntaxes/astro-markdown.tmLanguage.json`) attempts to include `source.asp.vb.net` but the scope cannot be found

- [ ] repository `vendor/grammars/atom-language-perl6` (from https://github.com/perl6/atom-language-perl6) (6 errors)
  - Invalid regex in grammar: `source.raku` (in `grammars/raku.cson`) contains a malformed regex (regex "`(?x) ( [\p{Digit}\p{Alpha}'\-_]+`...": unknown property name after \P or \p (at offset 16))
  - Invalid regex in grammar: `source.raku` (in `grammars/raku.cson`) contains a malformed regex (regex "`[\p{Digit}\p{Alpha}'\-_]+`": unknown property name after \P or \p (at offset 9))
  - Invalid regex in grammar: `source.raku` (in `grammars/raku.cson`) contains a malformed regex (regex "`(?x)(?<!\\)(\$|@|%|&)(?!\$)(`...": unknown property name after \P or \p (at offset 75))
  - Invalid regex in grammar: `source.raku` (in `grammars/raku.cson`) contains a malformed regex (regex "`(`": missing ) (at offset 1))
  - Invalid regex in grammar: `source.raku` (in `grammars/raku.cson`) contains a malformed regex (regex "`)`": unmatched parentheses (at offset 0))
  - Invalid regex in grammar: `source.raku` (in `grammars/raku.cson`) contains a malformed regex (regex "`(?x)(\$|@|%|&)(\.|\*|:|!|\^|~|`...": unknown property name after \P or \p (at offset 57))

- [ ] repository `vendor/grammars/ballerina-grammar` (from https://github.com/ballerina-platform/ballerina-grammar) (1 errors)
  - Unknown keys in grammar: `source.ballerina` (in `syntaxes/ballerina.tmLanguage`) contains invalid keys (`tmlVariables`, `monarchVariables`)

- [ ] repository `vendor/grammars/c.tmbundle` (from https://github.com/textmate/c.tmbundle) (4 errors)
  - Invalid regex in grammar: `source.c.platform` (in `Syntaxes/Platform.tmLanguage`) contains a malformed regex (regex "`\b(?:A(?:APNot(?:CreatedErr|Foun`...": definition too long (282084 bytes))
  - Invalid regex in grammar: `source.c.platform` (in `Syntaxes/Platform.tmLanguage`) contains a malformed regex (regex "`\b(?:A(?:E(?:A(?:ddressDesc|rray`...": definition too long (52248 bytes))
  - Invalid regex in grammar: `source.c.platform` (in `Syntaxes/Platform.tmLanguage`) contains a malformed regex (regex "`\b(?:CATransform3DIdentity|KERNE`...": definition too long (33340 bytes))
  - Invalid regex in grammar: `source.c.platform` (in `Syntaxes/Platform.tmLanguage`) contains a malformed regex (regex "`(\s*)(\b(?:A(?:E(?:Build(?:Apple`...": definition too long (58589 bytes))

- [ ] repository `vendor/grammars/gap-tmbundle` (from https://github.com/dhowden/gap-tmbundle) (3 errors)
  - Invalid regex in grammar: `source.gap` (in `Syntaxes/GAP.tmLanguage`) contains a malformed regex (regex "`\b(16Bits_AssocWord|16Bits_Depth`...": definition too long (65523 bytes))
  - Invalid regex in grammar: `source.gap` (in `Syntaxes/GAP.tmLanguage`) contains a malformed regex (regex "`\b(IndicesChiefNormalSteps|Indic`...": definition too long (65529 bytes))
  - Invalid regex in grammar: `source.gap` (in `Syntaxes/GAP.tmLanguage`) contains a malformed regex (regex "`\b(SMTX_GoodElementGModule|SMTX_`...": definition too long (42470 bytes))

- [ ] repository `vendor/grammars/haxe-TmLanguage` (from https://github.com/vshaxe/haxe-TmLanguage) (1 errors)
  - Missing include in grammar: `documentation.markdown.injection.haxe` (in `helper/haxe-markdown-docs.tmLanguage`) attempts to include `text.html.markdown` but the scope cannot be found

- [ ] repository `vendor/grammars/language-crystal` (from https://github.com/atom-crystal/language-crystal) (1 errors)
  - Missing include in grammar: `source.crystal` (in `grammars/crystal.cson`) attempts to include `source.js.jquery` but the scope cannot be found

- [ ] repository `vendor/grammars/language-fontforge` (from https://github.com/Alhadis/language-fontforge) (1 errors)
  - Unknown keys in grammar: `source.afm` (in `grammars/afm.cson`) contains invalid keys (`foldStartPattern`, `foldEndPattern`)

- [ ] repository `vendor/grammars/language-haml` (from https://github.com/ezekg/language-haml) (1 errors)
  - Missing include in grammar: `text.haml` (in `grammars/ruby haml.cson`) attempts to include `source.ruby.rails` but the scope cannot be found

- [ ] repository `vendor/grammars/language-jsonnet` (from https://github.com/google/language-jsonnet) (1 errors)
  - Invalid regex in grammar: `source.jsonnet` (in `grammars/jsonnet.cson`) contains a malformed regex (regex "`\b[a-zA-Z_][a-z0-9A-Z_]*\s*(\([^`...": nothing to repeat (at offset 43))

- [ ] repository `vendor/grammars/language-ruby` (from https://github.com/atom/language-ruby) (1 errors)
  - Missing include in grammar: `source.ruby` (in `grammars/ruby.cson`) attempts to include `source.js.jquery` but the scope cannot be found

- [ ] repository `vendor/grammars/language-sass` (from https://github.com/atom/language-sass) (1 errors)
  - Missing include in grammar: `source.sassdoc` (in `grammars/sassdoc.cson`) attempts to include `source.html` but the scope cannot be found

- [ ] repository `vendor/grammars/language-shellscript` (from https://github.com/atom/language-shellscript) (1 errors)
  - Missing include in grammar: `source.shell` (in `grammars/shell-unix-bash.cson`) attempts to include `text.html.textile` but the scope cannot be found

- [ ] repository `vendor/grammars/language-yaml` (from https://github.com/atom/language-yaml) (1 errors)
  - Missing include in grammar: `source.yaml` (in `grammars/yaml.cson`) attempts to include `source.ruby.rails` but the scope cannot be found

- [ ] repository `vendor/grammars/mako-tmbundle` (from https://github.com/marconi/mako-tmbundle) (1 errors)
  - Missing include in grammar: `text.html.mako` (in `Syntaxes/HTML (Mako).tmLanguage`) attempts to include `comment.block` but the scope cannot be found

- [ ] repository `vendor/grammars/mathematica-tmbundle` (from https://github.com/shadanan/mathematica-tmbundle) (1 errors)
  - Invalid regex in grammar: `source.mathematica` (in `Syntaxes/Mathematica.tmLanguage`) contains a malformed regex (regex "`(\b|(?<=_))(Abort|AbortKernels|A`...": definition too long (54020 bytes))

- [ ] repository `vendor/grammars/objective-c.tmbundle` (from https://github.com/textmate/objective-c.tmbundle) (2 errors)
  - Invalid regex in grammar: `source.objc.platform` (in `Syntaxes/Platform.tmLanguage`) contains a malformed regex (regex "`\b(?:AB(?:AddRecordsError|Multip`...": definition too long (32854 bytes))
  - Invalid regex in grammar: `source.objc.platform` (in `Syntaxes/Platform.tmLanguage`) contains a malformed regex (regex "`\b(?:A(?:M(?:Action(?:A(?:pplica`...": definition too long (44404 bytes))

- [ ] repository `vendor/grammars/ruby-slim.tmbundle` (from https://github.com/slim-template/ruby-slim.tmbundle) (1 errors)
  - Missing include in grammar: `text.slim` (in `Syntaxes/Ruby Slim.tmLanguage`) attempts to include `source.ruby.rails` but the scope cannot be found

- [ ] repository `vendor/grammars/sublime-autoit` (from https://github.com/AutoIt/SublimeAutoItScript) (2 errors)
  - Invalid regex in grammar: `source.autoit` (in `AutoIt.tmLanguage`) contains a malformed regex (regex "`\b(?i:_array1dtohistogram|_array`...": definition too long (39591 bytes))
  - Invalid regex in grammar: `source.autoit` (in `AutoIt.tmLanguage`) contains a malformed regex (regex "`\b(?i:_guictrltoolbar_getbuttoni`...": definition too long (39600 bytes))

- [ ] repository `vendor/grammars/turtle.tmbundle` (from https://github.com/peta/turtle.tmbundle) (5 errors)
  - Invalid regex in grammar: `source.turtle` (in `Syntaxes/Turtle.tmLanguage`) contains a malformed regex (regex "`(?x)  (?<PNAME_NS> (?: (?: [\`...": PCRE does not support \L, \l, \N{name}, \U, or \u (at offset 68))
  - Invalid regex in grammar: `source.turtle` (in `Syntaxes/Turtle.tmLanguage`) contains a malformed regex (regex "`(?x)( (?: [\p{L}\p{M}] | [:0`...": PCRE does not support \L, \l, \N{name}, \U, or \u (at offset 121))
  - Invalid regex in grammar: `source.turtle` (in `Syntaxes/Turtle.tmLanguage`) contains a malformed regex (regex "`(?x)  (?<PN_CHARS_U>[\p{L}\p{M`...": PCRE does not support \L, \l, \N{name}, \U, or \u (at offset 73))
  - Invalid regex in grammar: `source.turtle` (in `Syntaxes/Turtle.tmLanguage`) contains a malformed regex (regex "`\[[\u20\u9\uD\uA]*\]`": PCRE does not support \L, \l, \N{name}, \U, or \u (at offset 4))
  - Invalid regex in grammar: `source.turtle` (in `Syntaxes/Turtle.tmLanguage`) contains a malformed regex (regex "`(?x)((?<=\s|^|_)(?:[\p{L}\p{M}] `...": PCRE does not support \L, \l, \N{name}, \U, or \u (at offset 57))

- [ ] repository `vendor/grammars/vscode-lean` (from https://github.com/leanprover/vscode-lean) (7 errors)
  - Unknown keys in grammar: `source.lean.markdown` (in `syntaxes/lean-markdown.json`) contains invalid keys (`Repository[lists].Patterns[0].why`, `Repository[lists].Patterns[1].why`, `Repository[raw_block_disabled].why`, `version`, `information_for_contributors`)
  - Missing include in grammar: `source.lean.markdown` (in `syntaxes/lean-markdown.json`) attempts to include `text.html.derivative` but the scope cannot be found
  - Missing include in grammar: `source.lean.markdown` (in `syntaxes/lean-markdown.json`) attempts to include `text.log` but the scope cannot be found
  - Missing include in grammar: `source.lean.markdown` (in `syntaxes/lean-markdown.json`) attempts to include `text.git-commit` but the scope cannot be found
  - Missing include in grammar: `source.lean.markdown` (in `syntaxes/lean-markdown.json`) attempts to include `source.json.comments` but the scope cannot be found
  - Missing include in grammar: `source.lean.markdown` (in `syntaxes/lean-markdown.json`) attempts to include `text.git-rebase` but the scope cannot be found
  - Missing include in grammar: `source.lean.markdown` (in `syntaxes/lean-markdown.json`) attempts to include `source.asp.vb.net` but the scope cannot be found
 
$

I've kept the ability to view these warnings for situations where a grammar author may question why the syntax highlighting on GitHub.com doesn't match what they see in something like VS Code.

As part of this PR, I've also converted the compiler to using Go modules, updated the build env for it, and updated urfave/cli to v2 so we can take advantage of default values which needed a few other tweaks due to a change in the API.

I'll update the Docker container used to compile the grammars once this PR has been merged.

Checklist:

  • I am adding new or changing current functionality
    • I have added or updated the tests for the new or changed functionality.
      The compiler needs a lot more tests, but that's an effort for another day.

@lildude lildude requested a review from a team as a code owner August 3, 2021 09:14
@lildude lildude requested a review from Alhadis August 3, 2021 09:15
script/add-grammar Show resolved Hide resolved
script/add-grammar Outdated Show resolved Hide resolved
script/add-grammar Outdated Show resolved Hide resolved
tools/grammars/compiler/converter.go Outdated Show resolved Hide resolved
tools/grammars/compiler/converter.go Outdated Show resolved Hide resolved
tools/grammars/compiler/converter.go Outdated Show resolved Hide resolved
tools/grammars/compiler/converter.go Outdated Show resolved Hide resolved
@lildude lildude merged commit 493007b into master Aug 3, 2021
@lildude lildude deleted the lildude/remove-grammar-warnings branch August 3, 2021 14:55
@lildude lildude mentioned this pull request Aug 3, 2021
18 tasks
@github-linguist github-linguist locked as resolved and limited conversation to collaborators Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants