-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: ignore duplicated targets? #6286
Conversation
What about a warning? It's not clear to me whether this would ever be intended behavior, or whether it would be important for someone to know they had added the same target twice. |
@dberenbaum, it could happen with typos when similar targets exist. The main reason for this PR is that our internals cannot handle this properly (especially the graph checks), so we have to handle it at the top. I'll add a warning then. |
144dfeb
to
f4001e5
Compare
dupes = counter.most_common(n=2) | ||
if dupes: | ||
msg = ", ".join(f"[b]{key}[/]" for key, _ in dupes) | ||
ui.error_write(f"ignoring duplicated targets: {msg}", styled=True) |
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.
hmm, the capitalization of message (or, not) could be another topic for the UI discussion.
f4001e5
to
63245d3
Compare
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.
LGTM!
Thank you for the contribution - we'll try to review it as soon as possible. 🙏