Snippet List
Rough check for unused methods in our apps. Scans models, views, utils, api, forms and signals
files for what look like methods calls, then looks at all of our classes' methods to ensure each
is called. Do not trust this blindly but it's a good way to get leads on what may be dead code. Assumes a setting called `LOCAL_APPS` so it only bothers to look at the code you've written rather than everything in `INSTALLED_APPS`.
Refactors two similar django template files to use `{% block %}` tags.
Takes two template files, where one is a modified version of the other, and looks for differences and similiarities between the two.
It then generates refactored (and renamed) versions of each file and a third 'base' file, adding an `{% extends %}` tag as appropriate.
Block tags are named with matching numbers in all 3 files, making it easy to do a search and replace with more meaningful labels.
`sample_data_in_base` controls whether or not the content from file 1 is copied into place in the base file as an example.
Problems: it doesn't identify open `{% for %}` or `{% if %}` tags, so this needs some manual fixing (moving the `{% endfor %}` and `{% endif %}` tags into the proper blocks). It doesn't add the correct path for the `{% extends %}` tag either (ie. `"app/base.html"`). `collapse_whitespace` is not working at all.
2 snippets posted so far.