question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Doesn't recognize yaml syntax for regular expressions as valid.

See original GitHub issue

Describe the bug

Valid YAML syntax for regular expressions reported as invalid (unknown tag)

Expected Behavior

Entries should not display an error.

Current Behavior

Entries are flagged as unknown tag

Steps to Reproduce

  1. Create a file and ensure language is set to YAML.
  2. Use the following yaml:
---

case-insensitive: !ruby/regexp "/George McFly/i" 
complex: !ruby/regexp "/\\A\"((?:[^\"]|\\\")+)\"/" 
simple: !ruby/regexp '/a.b/' 
  1. Observe error listed under text !ruby/regexp -> Invalid Tag: <!ruby/regexp>

Environment

  • Windows
  • Mac
  • Linux
  • other (please specify)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
JPinkneycommented, Nov 17, 2020

It looks like the default built in schemas are broken, I’ve just filed an issue: https://github.com/redhat-developer/yaml-language-server/issues/356. Those ones are supposed to work out of the box

0reactions
vtcifercommented, Nov 16, 2020

In quick testing, I get the same behaviour with explicit tags, that are defined within the spec, examples given in 2.23.

---
not-date: !!str 2002-04-28

picture: !!binary |
 R0lGODlhDAAMAIQAAP//9/X
 17unp5WZmZgAAAOfn515eXv
 Pz7Y6OjuDg4J+fn5OTk6enp
 56enmleECcgggoBADs=

image

This is certainly not extensive testing, but it appears that no tags are supported natively, and that all must be defined in yaml.customTags.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CI Lint doesn't recognize a valid RegExp as such - GitLab
Summary. CI fails identifying some RegExps as a valid ones, failing the CI linter check. Steps to reproduce. Below yaml ci-script results in ......
Read more >
Avoid YAML formatting problems | Filebeat Reference [8.5]
If you need to specify a regular expression in a YAML file, it's a good idea to wrap the regular expression in single...
Read more >
Regex to match key in YAML - python - Stack Overflow
yaml using 'safe'-mode). What you need to do, is regular expression match the keys of the value associated with server , not the...
Read more >
Everything you need to know about Regular Expressions
You'll get a true or false result indicating whether the string belongs to the set of zip codes the regex pattern represents. Let's...
Read more >
Use of a regex stored inside a YAML file
ruby/regexp before your regex and wrapping it in single quotes in your settings.yml file. That still doesn't fix the issue with the RegExp...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found