Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks done
rgoldberg opened this issue Jan 2, 2025 · 1 comment
Open
2 tasks done
Labels
enhancement Ideas for improvements of existing features and rules.

Comments

@rgoldberg
Copy link

rgoldberg commented Jan 2, 2025

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.

@SimplyDanny SimplyDanny added the enhancement Ideas for improvements of existing features and rules. label Jan 2, 2025
@SimplyDanny
Copy link
Collaborator

With respect to the option's name: It should be a bit more descriptive, like allow_visibility: private or similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Ideas for improvements of existing features and rules.
Projects
None yet
Development

No branches or pull requests

2 participants