Vulture, the scavenger of dead Python code.

Rahul Jha (~RJ722)


0

Votes

Description:

Maintaining a high level of code quality is important for any serious project. One aspect of this is ensuring that all code is actually used. There are many reasons for dead code ending up in a project. The most common is refactoring, but another is misspellings, which are only detected at runtime for dynamic languages. Finding and removing dead code allows to keep the code base clean and reduces bugs.

Vulture is a command line tool which helps find dead code - unused code in Python programs and it is useful for cleaning up and finding errors in large code bases. If you run Vulture on both your library and test suite you can find untested code. Due to Python's dynamic nature, static code analyzers like Vulture are likely to miss some dead code. Also, code that is only called implicitly may be reported as unused. Nonetheless, Vulture can be a very helpful tool for higher code quality.

Vulture currently has a number of open issues and TODO’s, consisting of interesting feature requests, enhancements or bug reports, which we can work on during the devsprints.

Some of the most interesting ones are listed below:

  • Fix failing tests on Python 3.8 (#166)
  • Make Vulture available as a flake8 plugin. (#161)
  • Detect unused variables in assignment expressions under Python 3.8+ (TODO)
  • Scan f-strings under Python 3.8+. (TODO)
  • Use end_lineno and end_col_offset attributes when running Python 3.8+. (TODO)

Prerequisites:

For setting up the development and testing environment, please go through Vulture's contribution guide.

It will be really helpful if participants can familiarize themselves with Python’s ast module before coming to the devsprint.

Speaker Info:

Rahul is a final year Electronics Engineering student at Aligarh Muslim University.

He is the co-author of, and currently maintains, Vulture. He loves programming robots. Currently, he is working with the AUV ZHCET Team on an Autonomous Underwater Vehicle, Safina-é-Aabdoz.

Other than programming, he has interest in Urdu Shayari, history and politics. He sometimes write about this stuff at rj722.github.io.

Speaker Links:

You may like to visit my blog - I try to write about technology, politics and mathematics. You can check out my projects at https://github.com/RJ722.

Twitter: https://twitter.com/rahul722j

The best way to reach me is through e-mail: rj722@pm.me, rahul722j@gmail.com.

You may also find me lurking in #dgplug, #qutebrowser and #python-india channels on freenode. (IRC Nick: RJ722)

Section: Developer tools and automation
Type: DevSprint
Target Audience: Intermediate
Last Updated: