Skip to content

Make pragma syntax more intutiveΒ #188

@edmorley

Description

@edmorley

In #179 and #187, there was confusion about the current pragma syntax, and that pragma: some actually means pragma: no cover if some.

Whilst the situation can be improved by README changes (covered by #187), I wonder whether adjusting the supported syntax might help make the rules self-documenting, and reduce the chance for confusion?

For example, what about this syntax?

# pragma: no cover py-gte-311

ie: coverage-conditional-plugin would strip the literal string prefix no cover (if found), leaving the rule name of py-gte-311, and then behave as it does currently.

This syntax has the advantage of being clearer, and also has a nice parity with the existing no cover syntax.

For backwards compatibility (and to support a more concise syntax for people who prefer it), coverage-conditional-plugin could still support the current syntax alongside the above new syntax.

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