-
Notifications
You must be signed in to change notification settings - Fork 166
add lint depend_on_referenced_packages #2659
add lint depend_on_referenced_packages #2659
Conversation
example/all.yaml
Outdated
| linter: | ||
| rules: | ||
| - always_declare_return_types | ||
| - always_depend_on_packages_you_use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in general I think we're trending away from "always" and similar prefixes. Bike shedding names...
direct_package_dependencies
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
explicit_package_dependencies
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or depend_on_referenced_packages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fine with any of these, I like depend_on_referenced_packages probably the most?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went with that name for now, LMK if you want to change it
|
So awesome. Modulo name bike-shedding, this looks great! EDIT: also a perf question. |
|
Never mind! |
|
And hey, nice perf improvement! https://github.com/dart-lang/linter/pull/2659/checks?check_run_id=2624270876#step:5:111 Looks like this is now down from 15ms in benchmarks to 2! |
Description
Adds a new lint,
depend_on_referenced_packages. This applies to all imports and exports.For files under the
liborbindir, only packages in thedependenciessection may be referenced. For all other files any package listed indev_dependenciesis also allowed.Fixes dart-lang/sdk#57175