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

UnusedImport should not be triggered for --import:mymodule #13185

Open
timotheecour opened this issue Jan 17, 2020 · 0 comments
Open

UnusedImport should not be triggered for --import:mymodule #13185

timotheecour opened this issue Jan 17, 2020 · 0 comments

Comments

@timotheecour
Copy link
Member

timotheecour commented Jan 17, 2020

UnusedImport should not be triggered for --import:mymodule; it gets triggered on each module in the project that doesn't use mymodule.

While the current behavior is technically correct, it's more pedantic than useful.

Example

# main.nim:
import ./t0935b

# t0935b.nim:
# whatever

Current Output

nim c --import:std/times t0935.nim
UnusedImport gets triggered for each module in the project (that doesn't use the imported module)

t0935b.nim(1, 2) Warning: imported and not used: 'times' [UnusedImport]
t0935.nim(1, 2) Warning: imported and not used: 'times' [UnusedImport]

Expected Output

no warning, or, ideally, only 1 warning if imported module times was never used in the whole project

Additional Information

  • devel 107352f
  • would be nice to support --import:mymodule:frommodule to add the import only in frommodule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant