Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

Pycrastinate: TODO less, DO more

PyCon Sweden 2014
by

Isaac Bernat

on 22 May 2014

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Pycrastinate: TODO less, DO more

Take control
Pycrastinate
TODO less, DO more
Concepts
Details
by
Isaac Bernat
May 20 - 2014
github.com/isaacbernat
Avoid bad practices
Code cleanup
HOWTO
Bonus slides
Use Cases
Pycrastinate
TODO less, DO more
over creeping FIXMEs
1) Search code for FIXMEs*
2) Filter >90 and <15 days old
3) Email report to assess severity
1) Search public API for
kwargs
*
2) Filter >180 days old
3) Raise `AssertionError`
TODO: ask for questions
by
Isaac Bernat
May 20 - 2014
1) Search for TODOs, XXXs, HACKs...
2) Filter out those <6 months old*
3) Email reports to committers
config.py
Enclose
gather_git_blames_shell
"one-liner"
Why use pycrastinate?
a summary of key arguments
Convenience
No setups
Use it out of the box. No weird formats.
The only dependency is python 2.7/3.3+
Modularity
Easily extensible to meet your needs.
Speed
<3.5 sec. >240k lines, >1.7k .py, >60 hits
(django)
found 2 TODOs from 2006 (!)
Pycrastiwhat!?
Try it out, tune it and master it!
Error types
Analogy: What's a python function?
Modern C++: What You Need to Know - April 3, 2014 - Herb Sutter
source: http://channel9.msdn.com/Events/Build/2014/2-661
(at 10:48)
TODOs are jobs that the programmer thinks should be done, but for some reason can’t do at the moment. [...]
Whatever else a TODO might be,
it is not an excuse to leave bad code in the system.
Definition
source: Robert C. Martin, “Clean Code – A Handbook of Agile Software Craftsmanship”
Type I
Type II
incorrect rejection of a true
H0
failure to reject a false
H0
(false +)
(false -)
source: http://en.wikipedia.org/wiki/Type_I_and_type_II_errors
alpha >= 0, beta = 0
Chosen policy
(like bloom filters)
Find, act and analyse TODOs & co.
WTF is a "TODO"?
1. Gather files
2. Inspect files
3. Extract more metadata
file paths
4. Filter
line meta.
+ addition.
Find & Extract
5. Trigger actions
6. Aggregate
7. Create report
line metadata
8. Deliver/notify/etc.
report
Act & Analyse
line meta.
(subset)
*. Process results
Why I hunt TODOs
: "chain of processing elements arranged so that the output of each element is the input of the next" - en.wikipedia.org
Pipeline
Clone it, run it
pycrastinate.py
Take control
Add
exclude
and
send_email
modules
breaking Continuous Integration builds
Avoid bad practices
Add
raise_if_present
and
filter_by_age
modules
remove TODOs from an old stable codebase
Code cleanup
with "1-click-distance" links
New pipeline:
gather_git_blames_shell,

aggregate_by,
and
send_aggregated_email
modules
Comments on file parser policies
Null hypothesis
no relation found
(H0)
Modules ordered by priority
Initial results
Modules called
through enclose
Modules
Full transcript