-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
We should have a tool that finds unused diagnostic IDs #67306
Comments
Can I take this issue? This is my first time contributing to open source project. |
Sure, go ahead. |
Just to clarify, am I supposed to build diagnostic tools that finds unused diagnostic ID? In addition, Any suggestion on where should I start? |
You'd need to load |
Would https://github.com/apple/swift/tree/main/test/diagnostics be a good location for it? I was thinking we could probably add it as a new file, given how generally files on this folder seem to be designed to just check for a specific problem and i'd imagine this would probably fit under that description more or less. Something along the lines of |
It seems like there hasn't been much activity in this issue, so I went ahead and created the script. #68902 If you run the script right now, there are about 90 unused diagnostics. |
Using |
While working on #67075, I found several stale diagnostics that are declared in
Diagnostics*.def
files, but are never used anywhere in the compiler. I deleted most of the ones I found, but I’m sure there are many more.We should have a tool that scans lib/ and include/ for uses of diagnostic IDs and flags any that are never actually used. This could perhaps be a test that would fail if there are unused diagnostics.
This might be a good first issue for a new contributor who has reasonably strong Python or Swift skills but doesn’t have any experience with compilers yet.
The text was updated successfully, but these errors were encountered: