-
Notifications
You must be signed in to change notification settings - Fork 17
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
New Lint: avoid_using_api #89
New Lint: avoid_using_api #89
Conversation
These paths using the Glob pattern defined in the `glob` package https://pub.dev/packages/glob
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.
Good job! I've added a couple of suggestions here - please take a look.
lint_test/banned_external_code/class_source_ban/lib/class_source_ban.dart
Outdated
Show resolved
Hide resolved
lib/lints/banned_external_code/models/banned_external_code_entry_parameters.dart
Outdated
Show resolved
Hide resolved
I think that's everything! I do think documentation is needed, it will be very useful to know what all the lints are and what triggers them. Documentation for lints options can be included alongside that. |
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.
Looks good overall, great piece of work, @getBoolean!
Let's make the CI happy and we can merge.
I hope that is everything. |
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.
Outstanding piece of work, @getBoolean!
Nice! Our CI still fails - it feels like we need to fix those issues before merging? |
Not sure why its failing, I'll look into it when I get home from vacation in a week. |
I've confirmed it working correctly on Windows and MacOS. It might be an issue somewhere in |
Banning a source file in the same library is not supported, and it does not work on Linux even if forced with package:this_app
Good thing I setup Windows/Linux dual boot already, made tracking down the issue a lot easier. The issue was that I also found two edge cases while debugging and fixed them
|
Which makes sense -- that's what 'Deprecated' is for. Let's add this as a note in code documentation, I think the |
Done. @getBoolean Let me know if you're happy with my changes, then we can finish this up. |
@getBoolean Looks like there's some more issues -- CI still in the red. |
Before we merge, I want to investigate making @yurii-prykhodko-solid it looks like pub get needs to be run on those test packages in CI, is that possible? |
UPD: Happened to need this on a different project, CI now fetches dependencies for all |
This reverses the behavior: now if parent source if not found, it will not lint the node
Thanks, I think that is everything now |
Closes #81
This lint has a lot of edge cases. Tests are included to verify basic functionality.
Packages Added:
YamlMap
toMap
for the list of entriesUsage
External code can be "deprecated" when there is a better option available:
Result:
Advanced Usage
Each entry also has
includes
andexcludes
parameters. These paths utilize Glob patterns to determine if a lint entry should be applied to a file.For example, a lint to prevent usage of a domain-only package outside of the domain folder: