Skip to content

Poor error message when mixing list and key-value syntax #1916

Closed

Description

@bwilkerson

Given the following input:

linter:
  rules:
    close_sinks: false
    - empty_statements 

The message produced is

Expected a key while parsing a block mapping.

While the message is technically correct, it doesn't help the author of the file figure out how to fix the issue as much as it could. A user suggested something like

You can’t mix list and key-value syntax in the same object.

Please improve the error message for this situation.

Activity

  1. added
    type-enhancementA request for a change that isn't a bug
    contributions-welcomeContributions welcome to help resolve this (the resolution is expected to be clear from the issue)
    on Sep 8, 2022
  2. transferred this issue fromdart-archive/yamlon Dec 20, 2024
  3. jonasfj commented on Sep 30, 2026

    @jonasfj
    Member

    Fixed in #2610

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    contributions-welcomeContributions welcome to help resolve this (the resolution is expected to be clear from the issue)package:yamltype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions