tophat / codewatch

[deprecated] Monitor and manage deeply customizable metrics about your python code using ASTs
https://codewatch.io
Apache License 2.0
38 stars 3 forks source link

Improve readability of result output #68

Open cabiad opened 5 years ago

cabiad commented 5 years ago

just printing the various dicts isn't exactly user-friendly ;)

noahnu commented 5 years ago

what about modifying the Stats methods to gather node information as well, mainly file/lineno for simple debugging.

@visit(nodes.FunctionDef)
def count_bad_functions(node, stats, _):
  if node.name.startswith('deprecated'):
    stats.increment('deprecated_funcs', node)

and then stats would record basic node info so the final result output contains references explaining how the stats were reached.