Skip to content

one_declaration_per_file: ignore declarations less visible than a specified access level #5931

@rgoldberg

Description

@rgoldberg

New Issue Checklist

Feature or Enhancement Proposal

one_declaration_per_file should accept a config key, tentatively named allow_visibility (ignore & exclude were not chosen), which makes the rule ignore declarations whose access level is less visible or equal to the specified value. e.g., the following will configure the rule to not be triggered for any extra declarations whose access level is fileprivate or private:

one_declaration_per_file:
  allow_visibility: fileprivate

This would be useful to ignore helper types that won't be visible to other code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementIdeas for improvements of existing features and rules.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions