You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For every usage of runnableExamples within a module, an UnusedImport warning appears
when documentation is generated for that module, and the warnings occur in a file that nim doc itself generates.
For large modules with many documented procs and runnable examples, this can result in dozens of false warnings from the user's perspective.
Example
## An example module.procaddOne*(x: int): int=## Adds one to an integer and returns the result.
runnableExamples:
doAssertaddOne(1) ==2result= x +1
Generate the documentation with nim doc.
Current Output
Within the usual compiler output:
/home/jjp/.cache/nim/example_d/runnableExamples/example_examples.nim(1, 8) Warning: imported and not used: 'example_examples1' [UnusedImport]
Expected Output
The UnusedImport warning should not appear.
Possible Solution
Would disabling that warning via a pragma at the top of the generated file (in this case, example_examples.nim) work? Or are there better solutions?
Additional Information
Version info:
$ nim -v
Nim Compiler Version 0.20.99 [Linux: amd64]
Compiled at 2019-07-24
Copyright (c) 2006-2019 by Andreas Rumpf
git hash: 8c93c692b95da7b19a88cc0d56a8cdd20e3ae576
active boot switches: -d:release
The text was updated successfully, but these errors were encountered:
For every usage of
runnableExamples
within a module, an UnusedImport warning appearswhen documentation is generated for that module, and the warnings occur in a file that
nim doc
itself generates.For large modules with many documented procs and runnable examples, this can result in dozens of false warnings from the user's perspective.
Example
Generate the documentation with
nim doc
.Current Output
Within the usual compiler output:
Expected Output
The UnusedImport warning should not appear.
Possible Solution
Would disabling that warning via a pragma at the top of the generated file (in this case, example_examples.nim) work? Or are there better solutions?
Additional Information
Version info:
The text was updated successfully, but these errors were encountered: