Code analysis and automated fixes
Code completion is a standard feature of most code editors and IDEs. As we’ve seen, not all completion engines are created equally. The same can be true for analysis engines. A code analysis engine is an extension of code completion in concept, if not in implementation. Code completion tries to predict the code you are writing and helps you finish more quickly. Code analysis examines the code you’ve written and attempts to determine whether or not the code will work when you run it. Just as with code completion, there are differing levels of complexity at play here and different processes examining different things.
The simplest form of analysis is called linting. Pretty much every programming language has a linting tool, and Python is no exception. While there are many to choose from, PyCharm uses the popular pylint
library by default.
A linter runs a tacit analysis of your code through a process of pattern matching. There are...