Skip to content

Add different configuration for different files #3767

Open
@Conchylicultor

Description

@Conchylicultor

Is your feature request related to a problem? Please describe

This request is similar request to #618 (Add different configuration for different sub directories) but at the file level.

Currently, pylint apply the same config instinctively to all files. However some rules should be applied only to specific files.

For instance it is really frequent in test files to access private members (assert module._some_fn()). Currently all our tests files trigger hundreds of protected-access warnings.

Describe the solution you'd like

We would like a way to overwrite specific rules for all *_test.py files.

For instace being able to register some pattern="**/*_test.py" with custom rules associated. All files which would match the pattern would use the special pylint rules.

Note: if the pattern accept directory names (some_dir/**), it would also solve #618 while being more flexible (like: **/some_dir/**).

Metadata

Metadata

Assignees

No one assigned

    Labels

    ConfigurationRelated to configurationEnhancement ✨Improvement to a componentHelp wanted 🙏Outside help would be appreciated, good for new contributorsHigh effort 🏋Difficult solution or problem to solve

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions