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 a duplicatedTargetProductName linter #6205

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rsarv3006
Copy link
Contributor

@rsarv3006 rsarv3006 commented Apr 18, 2024

Resolves #6118

Short description πŸ“

Add a duplicated target product name linter. Also checks for destinations as well. Thanks @kwridan for pointing that out.

How to test the changes locally 🧐

Include a set of steps for the reviewer to test the changes locally (see the documentation for reference).

Contributor checklist βœ…

  • The code has been linted using run mise run lint:fix
  • The change is tested via unit testing or acceptance testing, or both
  • The title of the PR is formulated in a way that is usable as a changelog entry
  • In case the PR introduces changes that affect users, the documentation has been updated

Reviewer checklist βœ…

  • The code architecture and patterns are consistent with the rest of the codebase
  • Reviewer has checked that, if needed, the PR includes the label changelog:added, changelog:fixed, or changelog:changed, and the title is usable as a changelog entry

Comment on lines +66 to +68
let destinations = $1.destinations.sorted(by: { a, b in
a.rawValue < b.rawValue
}).map(\.rawValue).joined(separator: ",")
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we should check destinations. As per @kwridan's comment here, it's fine to have duplicate product names as long as they don't end up being linked to the same target. Sure, supporting multiple destinations was one of the use cases for this, but there might be different valid scenarios that we'd want to allow.

Ideally, we should check for all rootTargets whether any of their transitive dependencies has a duplicate product name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the clarification! I will update and push when I have a chance.

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.

Detect targets with duplicate product name
2 participants