TODO.txt 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. Coverage.py TODO
  2. Key:
  3. * Heading
  4. - Not done yet.
  5. + Done.
  6. x Not going to do.
  7. * 4.0
  8. - What defaults should change?
  9. x --source = . ?
  10. x --branch = True ?
  11. - Remove 2.3, 2.4, 2.5 limitations
  12. + set, sorted, reversed, rpartition
  13. + generator expressions
  14. + decorators
  15. + collections.defaultdict
  16. + .startswith((,))
  17. + "with" statements
  18. - .format() ?
  19. + try/except/finally
  20. + with assertRaises
  21. + addCleanup instead of tearDown
  22. + exec statement can look like a function in py2 (since when?)
  23. - runpy ?
  24. + we can use "except ExcClass as e:"
  25. - Plugins
  26. + Clean up
  27. + implement plugin support in CTracer
  28. + remove plugin support from PyTracer
  29. x add services:
  30. - filelocator
  31. - warning
  32. - dynamic_source_filename: return should be a canonical path
  33. - update the omit test to use "quux*" instead of "*quux*"
  34. + docs
  35. + Make reports use filenames, not module names
  36. - documentation
  37. - test helpers
  38. + cov.config["run:branch"] api (well, coverage.get_option etc)
  39. + "added in 4.0"
  40. - tweaks to theme?
  41. - Plugins!
  42. Once per process
  43. Once per file
  44. - create a file tracer
  45. - call its has_dynamic_source_file()
  46. Once per call
  47. Once per line
  48. - build process
  49. - don't publish to nedbat.com any more (but still need the sample html reports)
  50. + don't need .px tooling
  51. - write a new nedbat.com/code/coverage page.
  52. - all doc links should point to rtfd
  53. + Remove code only run on <2.6
  54. + Change data file to json
  55. + Create data api
  56. + gevent, etc.
  57. + Remove the old command-line syntax
  58. + A pain, b/c of the structure of the tests.
  59. + BTW: make an easier way to write those tests.
  60. - tests
  61. - test the kit has the right contents
  62. - test the kit installs the right stuff
  63. * --source stuff:
  64. + warn if a package is never found.
  65. + warn if no data was collected
  66. - tie --source into reporting
  67. * Soon
  68. + Better omit handling that ignores files during measurement.
  69. - Deal with ~ in specified paths correctly.
  70. + while TRUE claims to be partial.
  71. + A way to mark lines as partial branches, with a regex?
  72. + Default to "while True:", "while 1:"
  73. + HTML keyboard short cuts
  74. * 3.2
  75. + Some kind of indication in the HTML where yellow lines aren't going.
  76. - Profile the reporting code: it's REALLY slow.
  77. - parser is doing some redundant work.
  78. + Analysis class should do rolling up of stats also (actually Numbers)
  79. + Update docs for --branch.
  80. x self.coverage.data.has_arcs is ugly.
  81. + Branches that never jump to nocover lines shouldn't be marked as partial.
  82. (see top of test_cogapp for examples)
  83. + Maybe turning off yellow lines should make those lines green?
  84. + A missing branch to leave the function shows an annotation of -1. Now "exit".
  85. + XML report needs to get branch information.
  86. + Add branch info to "coverage debug data"
  87. + Polish up the help, and double-check the docs.
  88. * Speed
  89. + C extension collector
  90. - bitvector in trace extension.
  91. - Ignore certain modules
  92. + Record linenos rather than (file,lineno) pairs in tracer.
  93. x Tricky swapping of collector like figleaf, pycov, et al. (Don't need to do
  94. this with C collector).
  95. - Seems like there should be a faster way to manage all the line number sets in
  96. CodeParser.raw_parse.
  97. - If tracing, canonical_filename_cache overlaps with should_trace_cache. Skip
  98. canonical_filename_cache. Maybe it isn't even worth it...
  99. - Would pre-allocating line number integers make the C tracer faster? It would
  100. use less memory.
  101. * Accuracy
  102. - Record magic number of module to ensure code hasn't changed
  103. - Record version of coverage data file, so we can update what's stored there.
  104. - Record options in coverage data file, so multiple runs are certain to make
  105. sense together.
  106. - Do I still need the lines in annotate_file that deal specially with "else"?
  107. * Power
  108. + Branch coverage
  109. Titus' idea:
  110. 1: if a:
  111. 2: b = 2
  112. 3: c = 3
  113. if the coverage data shows 1,2,3, it was if-then. if it's 1,3, then the
  114. missing else was executed.
  115. + API for getting coverage data.
  116. - Instruction tracing instead of line tracing.
  117. - Path tracing (how does this even work?)
  118. - Count execution of lines
  119. - Track callers of functions (ala std module trace)
  120. - Method/Class/Module coverage reporting.
  121. - .coverage files that can be kept separate, rather than accumulated.
  122. - test/coverage map: http://rbtcollins.wordpress.com/2009/09/16/back-from-hiatus/
  123. - Similar to figleaf's sections.
  124. * Convenience
  125. - Command line modules should also be directories, meaning all the modules in that
  126. directory.
  127. - Why can't a morf also be a string, the name of a module?
  128. - ignore by module as well as file?
  129. + Use a .coveragerc file to control coverage.py without the programmatic API.
  130. - Add a --data switch to explicitly control the data file on the command line.
  131. x Why can't you specify execute (-x) and report (-r) in the same invocation?
  132. Maybe just because -x needs the rest of the command line?
  133. + Support 2.3 - 3.1!
  134. http://pythonology.blogspot.com/2009/02/making-code-run-on-python-20-through-30.html
  135. http://www.rfk.id.au/blog/entry/preparing-pyenchant-for-python-3
  136. http://pydev.blogspot.com/2008/11/making-code-work-in-python-2-and-3.html
  137. + Explicitly set pickle protocol to 2.
  138. - An inference mode that marks lines as executed if they "must have been" executed:
  139. class definitions, etc, when coverage is started after the class is defined.
  140. - Different categories of exclude pragma? So you can enable and disable them
  141. from the command line, to reconsider exclusions.
  142. + Reporting on files never touched by coverage.py (package completeness)
  143. - A setup.py command? http://jeetworks.org/node/50
  144. - Deltas: indicate the change in coverage percentage from the last run.
  145. + Show lines missing rather than lines run in the reporting, since that's what
  146. you need to focus on.
  147. * Beauty
  148. + HTML report
  149. - Colored bars indicating coverage per file.
  150. - Package navigation.
  151. - Rolled-up statistics.
  152. - Some way to focus in on red and yellow
  153. - Show only lines near highlights?
  154. + Jump to next highlight?
  155. + Keyboard navigation: j and k.
  156. - Cookie for changes to pyfile.html state.
  157. + Clickable column headers on the index page.
  158. + Syntax coloring in HTML report.
  159. + Dynamic effects in HTML report.
  160. + Footer in reports pointing to coverage.py home page.
  161. + Baseline grid for linenumber font.
  162. + Separate out css and HTML.
  163. + Does it work right with utf-8 source files? http://www.python.org/dev/peps/pep-0263/
  164. - Use vim modeline to determine tab width: http://vimdoc.sourceforge.net/htmldoc/options.html#modeline
  165. * Community
  166. + New docs, rather than pointing to Gareth's
  167. + Min python version is 2.3.
  168. - Three phases of work:
  169. - Collection
  170. - Analysis
  171. - Reporting
  172. - Distinction between:
  173. - ignore (files not to collect)
  174. - exclude (lines not to report as missed)
  175. - omit (files not to report)
  176. - Changes from coverage.py 2.x:
  177. - Bare "except:" lines now count as executable code.
  178. - Double function decorators: all decorator lines count as executable code.
  179. x Document the .coverage file format.
  180. + HTML reporting.
  181. - Much more detail about what's in the report.
  182. - References between pages are off:
  183. - They have <em> tags around them.
  184. - They use #anchors that don't survive the px->html conversion.
  185. + Be sure --help text is complete (-i is missing).
  186. + Host the project somewhere with a real bug tracker: bitbucket.org
  187. + Point discussion to TIP
  188. - PEP 8 compliance?
  189. * Programmability
  190. + Don't use sys.exit in CoverageScript.
  191. + Remove singleton
  192. + Initialization of instance variables in the class.
  193. * Installation
  194. x How will coverage.py package install over coverage.py module?
  195. x pip can't install it: it reads the coverage.py html page, and finds the kit link,
  196. but then can't handle the root-relative link.
  197. * Modernization
  198. + Decide on minimum supported version
  199. + 2.3
  200. + Get rid of the basestring protection
  201. + Use enumerate
  202. + Use sets instead of dicts
  203. + Switch from getopt to optparse.
  204. + Get rid of the recursive nonsense.
  205. + Docstrings.
  206. + Remove huge document-style comments.
  207. - Better names:
  208. + self.cache -> self.cache_filename -> CoverageData.filename
  209. + self.usecache -> CoverageData.use_file
  210. - More classes:
  211. - Module munging
  212. + Coverage data files
  213. + Why are some imports at the top of the file, and some in functions?
  214. + Get rid of sys.exitfunc use.
  215. + True and False (with no backward adaptation: the constants are new in 2.2.1)
  216. + Get rid of compiler module
  217. + In analyzing code
  218. + In test_coverage.py
  219. + Style:
  220. + lineno
  221. + filename
  222. * Correctness
  223. - What does -p (parallel mode) mean with -e (erase data)?
  224. * Tests
  225. + Switch to a real test runner, like nose.
  226. + Test both the C trace function and the Python trace function.
  227. + parser.py has no direct tests.
  228. + Tests about the .coverage file.
  229. + Tests about the --long-form of arguments.
  230. + Tests about overriding the .coverage filename.
  231. - Tests about parallel mode.
  232. + Tests about assigning a multi-line string.
  233. - Tests about tricky docstrings.
  234. + Coverage test coverage.py!
  235. - Tests that tracing stops after calling stop()
  236. - More intensive thread testing.
  237. x Tests about the "import __main__" in cmdline.py
  238. + What happens if the -x script raises an exception?
  239. - Test that the kit has all the proper contents.