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

Can't handle embedded YAML or unsaved files #14

Closed
FichteFoll opened this issue May 22, 2020 · 0 comments · Fixed by #15
Closed

Can't handle embedded YAML or unsaved files #14

FichteFoll opened this issue May 22, 2020 · 0 comments · Fixed by #15

Comments

@FichteFoll
Copy link
Contributor

FichteFoll commented May 22, 2020

When I use a markdown file with YAML frontmatter (and sublimehq/Packages#2339), yamllint reports errors for regions that shouldn't be of any concern for it.

---
key: normal YAML frontmatter
---

*normal markdown*

Debug log:

SublimeLinter: sublime_linter.py:324  Delay linting 'test.md' for 0.5s
SublimeLinter: linter.py:1103         annotations: Checking lint mode 'background' vs lint reason 'on_modified'.  Ok.
SublimeLinter: linter.py:1103         yamllint: Checking lint mode 'background' vs lint reason 'on_modified'.  Ok.
SublimeLinter: #3118 linter.py:1120   yamllint: linting 'test.md'
SublimeLinter: #3117 linter.py:1120   annotations: linting 'test.md'
SublimeLinter: #3117 linter.py:1196   annotations: no output
SublimeLinter: #3118 linter.py:1636   Running ...

  /home/fichte/code/docs.sublimetext.io  (working dir)
  $ /usr/bin/yamllint --format parsable /tmp/test.md

SublimeLinter: #3118 linter.py:1202   yamllint: output:
  /tmp/test.md:5:9: [error] syntax error: expected '<document start>', but found '<scalar>' (syntax)
SublimeLinter: #3118 linter.py:1343   WARNING: Reported line '5' is not within the code we're linting.
Maybe the linter reports problems from multiple files or `line_col_base` is not set correctly.
SublimeLinter: sublime_linter.py:575  Linting 'test.md' took 0.29s

This issue only occurs for saved files, not for untitled views created via ctrl+n, because those are seemingly not checked at all.

It would be nice if the plugin only linted regions for which the source.yaml selector matches and regardless of whether the file is saved or not. The linter also seems to only run on the saved file despite advertising live updates on each modification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant