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

add no_top_public_members_in_executable_libraries #3453

Conversation

a14n
Copy link
Contributor

@a14n a14n commented Jun 14, 2022

Description

Top-level members in an executable library should be private (or relocated to within main), to prevent unused members.

BAD:

main() {}
void f() {}

GOOD:

main() {}
void _f() {}

Fixes #1258

@a14n a14n force-pushed the no_top_public_members_in_executable_libraries branch from 8bec400 to aea57c5 Compare June 14, 2022 15:23
@coveralls
Copy link

coveralls commented Jun 14, 2022

Coverage Status

Coverage increased (+0.6%) to 96.331% when pulling a99826d on a14n:no_top_public_members_in_executable_libraries into a91b233 on dart-lang:master.

@a14n a14n force-pushed the no_top_public_members_in_executable_libraries branch from aea57c5 to eb3541a Compare June 14, 2022 15:45
@a14n a14n force-pushed the no_top_public_members_in_executable_libraries branch from eb3541a to a99826d Compare June 14, 2022 15:50
@a14n a14n marked this pull request as ready for review June 14, 2022 20:20
@a14n
Copy link
Contributor Author

a14n commented Jun 16, 2022

PTAL

Copy link
Member

@bwilkerson bwilkerson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation looks fine; I can't speak to the question of whether this is a lint that we want to add (and that question should be discussed in the issue, not here).

@a14n a14n closed this Jul 11, 2022
@a14n a14n deleted the no_top_public_members_in_executable_libraries branch July 11, 2022 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ban public top-level members in a test
3 participants