icu4x
icu4x copied to clipboard
Lint docs tests for unused imports
I've come across a number of docs tests that have unused imports, which can be confusing to clients and developers.
We should clean up unused imports and then prevent them from being added again.
@Manishearth suggested running docs tests with -D warnings or a flag that causes the docs tests to fail if they have unused imports warnings.
There are also other lints like unused variables that should definitely be checked.
Hello there! I'd like to work on this issue! Could you please assign this to me?
There you go, let me know if you have any questions!
@robertbastian I'm sorry if I sound dumb, I'm new to the project. Just wanted to confirm something. When you say "docs tests", you mean the tutorials in the docs folder right? Also, if I need to do it for all the languages in the tutorials folder, is it possible to run all the tutorials with '-D warnings' to get error when unused imports exist?
Thanks for your help!
No, docs tests are the code in Rustdoc, i.e. things like this https://github.com/unicode-org/icu4x/blob/f4fe3c5f994bc448d21660430c06ab1f429a604d/components/list/src/list_formatter.rs#L97-L121. They are run by this CI job: https://github.com/unicode-org/icu4x/blob/f4fe3c5f994bc448d21660430c06ab1f429a604d/tools/make/tests.toml#L49-L53
Fixed by #4628, yes?
I would consider this fixed if we have CI that prevents backsliding.