Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Behaviour when using --convention #482

Open
@saroad2

Description

@saroad2

This is a followup issue for #478.

The question here is how the --convention flag affects the chosen rules to be executed when evaluating doctsring. Here is my suggestion:

I think the approach should be that you should split the violations into two categories:

Global - violations which are part of the pycodestyle guidelines
Convention specific - violations that are only relevant for a specific convention.

A definition of a convention-specific violation should look like:

D497 = D4xx.create_error('D497', 'This is a global rule', 'description')
D498 = D4xx.create_error(
    'D498', 'This is a sphinx rule', 'description', convention="sphinx"
)
D499 = D4xx.create_error(
    'D499',
    'This is a sphinx and google rule',
    'description',
    convention=["sphinx", "google"]
)

The global rule will be set by default with convention=None.
Rules that are convention-specific will run only if --convention has been raised with their convention. Global rules will always run. In that way we can prevent false-positive for convention-specific violations

One can choose to add/ignore a violation regardless of the chosen conversion by using --add-select or --add-ignore.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions