Skip to content

support a "comment/"reason" field for error mesages #877

@DetachHead

Description

@DetachHead

i think it'd be helpful if you could add more information about banned imports in your project, for example:

[[modules]]
path = "tests.**.test_*"
cannot_depend_on = ["tests.**.test_*"]
reason = "test files should not import from other test files. consider moving the imported symbol to a separate module such as a `conftest.py` instead"

this comment would then show up with the diagnostics, like so:

[FAIL] tests\test_foo.py:54: Cannot use 'tests.test_bar'. Module 'tests.test_foo' cannot depend on 'tests.test_bar'. reason: test files should not import from other test files. consider moving the imported symbol to a separate module such as a `conftest.py` instead

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