A Checklist Extension
I’m working on an extension to add checklists to the code review page! Checklists are really useful tools, as even the best of us can slip up on details when there’s zillions of things to think about. The B-17 Flying Fortress used a checklist to make it flyable. This extension will probably be used for the more modest goal of code convention reminders and catching common mistakes.
- Summary (CharField): A shorter description of what the checklist item is. Example: “Make sure variables are camel-cased
- Details (TextField): A longer description in case the item needs more detail than can be fit in one line. Can be shown on mouseover as a tooltip: http://jqueryui.com/tooltip/
- ForeignKey (GenericForeignKey): holds content_type and foreign_id, as described in http://stackoverflow.com/questions/881792/how-to-use-dynamic-foreignkey-in-django. content_type specifies whether the checklist item is associated with a user, a project (repository), or a team. On the review page, the query will grab all ChecklistItems associated with the team, the current project, and the current user.
- Separate foreign keys (ForeignKey) to User, Group, Repository
These remember checked items per review. They are updated when a draft is saved or a review is posted.
- Foreign key to user
- Foreign key to the code review
- Foreign key to the ChecklistItem
- Checked? (BooleanField) indicates whether the item is checked or not
As a dialog box which can be dragged or minimized (to not cover the code), or perhaps slide out from the edge of the page
Allows teams and projects to have shared checklists: Yes, by associating ChecklistItems with foreign keys to teams and projects
Allows individual users to add custom items to their lists: Yes, by the foreign key pointing to users
The list should be light-weight in operation, and minimal in appearance so as to keep focus on the code being reviewed: I like the dialog box thing, personally. Open to other designs too though.
Remember checked items per review (if I save a review draft, and log-in from another computer to continue, my checklist should remember what items I’ve already checked off): Yes, using ChecklistItemMarks
Remind the user if they try to publish a review with unchecked items on their list, in case they want to keep reviewing.: Will remember in implementation