Skip to content

Support for multi-line tables in pyproject.toml #961

@patrick91

Description

@patrick91

I do have a few per-file ignores in my project[1]. Do you think it is possible to add support for multi-line tables?

This works:

[tool.ruff]
line-length = 89
per-file-ignores = {"tests/federation/printer/*" = ["E501"], "tests/test_printer/test_basic.py" = ["E501"], "tests/pyright/test_federation.py" = ["E501"], "tests/test_printer/test_schema_directives.py" = ["E501"]}

This does not:

[tool.ruff]
line-length = 89
per-file-ignores = {
  "tests/federation/printer/*" = ["E501"], 
  "tests/test_printer/test_basic.py" = ["E501"], 
  "tests/pyright/test_federation.py" = ["E501"], 
  "tests/test_printer/test_schema_directives.py" = ["E501"]
}

Error:

error expected a table key, found a newline at line 196 column 21

I get the same error in VS Code:

CleanShot 2022-11-29 at 12 54 13@2x

My understanding is that multi-line tables are supported by TOML: toml-lang/toml#904

but it's a relatively new feature :)

Anyway, I'm fine with having the ignores on one line, it's not a big deal, I opened the issue just in case it is easy to implement and for others that might stumble on the same problem :)

[1] https://github.com/strawberry-graphql/strawberry/pull/2367/files#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711R196

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions