Show multiple errors when popping imports#112
Open
leamingrad wants to merge 1 commit into
Open
Conversation
leamingrad
force-pushed
the
tweak-ignored-import-helper
branch
from
December 8, 2021 10:27
f8d602a to
945eff0
Compare
Prior to this change, if we tried to pop multiple imports from the graph that did not exist, we would only raise an error for the first one. This meant that if we have multiple incorrect ignores for a contract, we will only see one of them each time we lint imports (which is a bad experience if you are trying to add a big list of potential ignores and whittle them down). This change raises a single error containing all of the missing imports. We sort the imports alphabetically to make things easier.
leamingrad
force-pushed
the
tweak-ignored-import-helper
branch
from
December 8, 2021 10:31
945eff0 to
8ee79a9
Compare
seddonym
requested changes
Dec 9, 2021
|
|
||
| if missing_imports: | ||
| # Sort the output to make it more helpful | ||
| missing_import_strings = sorted([str(i) for i in missing_imports]) |
Owner
There was a problem hiding this comment.
Not a blocker but we could make this just use a generator, i.e. sorted(str(i) for i in missing_imports)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prior to this change, if we tried to pop multiple imports from the graph
that did not exist, we would only raise an error for the first one. This
meant that if we have multiple incorrect ignores for a contract, we will
only see one of them each time we lint imports (which is a bad
experience if you are trying to add a big list of potential ignores and
whittle them down).
This change raises a single error containing all of the missing imports.