Working through all the tooling examples.
Debugging
Use the new
dbginstead of theIEx.pryas shown to trigger a debug.You can only
break!on public functions.You also can only
nexton public functions.Dave’s note is that he tends to raise an Exception to see what’s going on when he’s debugging.
Testing
I’ve been annoyed that VSCode’s does code hinting in comments. Now I see why, DocTest.
Adding DocTest to the TableFormatter caused me to change
print_headerandprint_separatortotable_headerandtable_separatorand print after call. Further promotes the ‘do one thing’ idiom and simplifies testing.I can see doing regular DocTests.
DocTests are good for demonstrating usage and do not replace UnitTests.
Added some fixtures to TableFormatter tests. Had been using
@values.fixtureis just a name, could be anything, butfixtureis descriptive.setupcan declare a tuple or a function returning a tuple.Add an
on_exitsection to thesetupblock to do any cleanup.Will need to read ExUnitProperties and dig into examples.
Added ExCoveralls to
issuesproject.
Code Dependencies
mix xref unreachable
mix xref warnings
mix xref callers [Module or function]
mix xref graph --format dot
dot -Grankdir=LR -Epenwidth=2 -Tpng -Ecolor=#a0a0a0 -o xref_graph.png xref_graph.dotServer Monitoring
iex> :observer.start()Source Code Formatting
I’m letting the IDE do the work.
mix formatAll notes and comments are my own opinion. Follow me at @rgacote@genserver.social