Skip to content

Add "also_exclude_lines" configuration option #1391

Closed
@ikonst

Description

@ikonst

When overriding exclude_lines e.g. to exclude pytest.fail or ..., we often include the existing DEFAULT_EXCLUDE pattern (currently \#\s*(pragma|PRAGMA)[:\s]?\s*(no|NO)\s*(cover|COVER)) to maintain the effect of existing "pragma: no cover"s.

This is cumbersome (the regex is large) and doesn't capture the intention, i.e. I have to explain to my team mates what this regex is and where it came from.

Introducing an also_exclude_lines configuration option (alternative name: "additional_exclude_patterns", which might do better to convey that those are regex patterns), that would be appended to the default list, could address that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions