hgcodesmell /

Filename Size Date modified Message
6 B
1.0 KB
4.8 KB
1.0 KB
Mercurial codesmell extension

This extension hooks in before commit and checks added lines for common
"smelly" changes.  If it finds any, it will show them and prompt whether
to continue committing.

To enable, activate it in your hgrc file like this:

    hgcodesmell = path/to/hgcodesmell.py

There is currently no other configuration you can set.

Smelly patterns that are currently recognized are:

* pdb.set_trace(), in Python files
* 1/0, in Python files
* print statements, in Python files
  (I know this is going to produce false positives, but print statements
  are also the debugging tool #1 for Python)
* vim "quit" commands that leak into the file because of wrong mode
* Windows newlines (only on non-Windows platforms)
* debugger; statements inside of Javascript files

You can add more of them by editing hgcodesmell.py's SMELLY_STUFF dictionary.

This extension is copyright 2009, 2010 by Georg Brandl, and can be
distributed under the GNU GPL version 2 or later.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.