binhonglee / coco

Code coverage for Nim lang (CLI + library)
MIT License
46 stars 3 forks source link

code style nits #11

Closed timotheecour closed 5 years ago

timotheecour commented 5 years ago

discard execShellCmd(&"mkdir {coverage} {nimcache}") => import os createDir(coverage) createDir(nimcache)

another example: execShellCmd(&"ls {fileinfo}") == 1 doesn't seem very portable; eg a user could have an alias for ls ; not sure how portable is return code 1, etc. maybe os. existsFile is what you want here?

another example: discard execShellCmd(&"rm -rf {fileinfo} {coverage} {nimcache}") this is downright dangerous if user passes a path with a space (not that it'd be wise, but still), eg: --report_path="tests foobar"