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

Detect duplicate types #138

Open
jl-wynen opened this issue Feb 28, 2024 · 5 comments
Open

Detect duplicate types #138

jl-wynen opened this issue Feb 28, 2024 · 5 comments

Comments

@jl-wynen
Copy link
Member

scipp/esssans#102 had a duplicate type. This can break pipelines. Can we detect them automatically somehow? Maybe we can use a heuristic to search for them in source code or hook into a linter to list all type definitions. This could be hooked into pre-commit.

@SimonHeybrock
Copy link
Member

Can you clarify what is duplicate and what broke? Having types with identical names in different modules sounds like a valid thing?

@jl-wynen
Copy link
Member Author

See the linked PR. There were two identically named types and some providers used one, other used the other. This meant that those providers did not connect into a pipeline as expected.

@SimonHeybrock
Copy link
Member

Yes, but can you clarify what Sciline could/should do about this? Isn't it a valid application to have types of the same naming in different packages or modules?

@jl-wynen
Copy link
Member Author

Valid but confusing.
But note that this issue is about types within a single project. I suggested check using an external tool, not in Sciline. This would prevent using the same name in different modules in the same package which is almost definitely a mistake.

@SimonHeybrock
Copy link
Member

Makes sense. Do you want to transfer the issue to another project then?

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

No branches or pull requests

2 participants