Skip to content

Rules with View of YAML (via Dasel) have wrong .Line and .Span numbers #1044

@osfameron

Description

@osfameron

Check for existing issues

  • Completed

Environment

MacOS 14.2.1, via Homebrew.

 vale -v
vale version 3.12.0

Describe the bug / provide steps to reproduce it

Test case at couchbaselabs/docs-style-guide@ffef7ca which can be run with npm test

  • Add a View for .yml
[test/fixtures/test.yml]
BasedOnStyles = Vale, write-good, proselint, Couchbase, Google
View = OpenAPIInclude
  • The view looks like
engine: dasel
scopes:
  - expr: description
    type: md
  • For .adoc files, the .Line ✅ and .Span ✅ records point to the location in the file that the .Match text comes from. This is a reasonable expected behaviour, and very convenient for e.g. matching against a Github pull request.

  • for many .yml matches, the .Line ✅ number is correct but the .Span ❌ matches from YAML's perspective, rather than the position in the file.

  • for some .yml matches (my guess is with scope: raw?) the .Line ❌ number is also incorrect, as it is calculated from the position that the matching expr starts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions