Flake8 FIXME/TODO Checker
flake8-fixme is a plugin for the Flake8 Python code checker that identifies temporary developer notes like FIXME, TODO, and XXX within source code. It helps enforce code quality by flagging these comments, ensuring they are addressed. The current version is 1.1.1, released in May 2019. As a Flake8 plugin, its release cadence is tied to its own maintenance and compatibility with Flake8 updates.
Common errors
-
flake8 --version output does not list 'flake8-fixme'
cause The flake8-fixme plugin is not installed in the same Python environment as the flake8 executable being run, or it's not installed at all.fixEnsure you have activated the correct virtual environment (if any) and run `pip install flake8 flake8-fixme`. Then, re-run `flake8 --version` to confirm `flake8-fixme` is listed. -
./my_file.py:1:8: T100 Fixme found (FIXME).
cause This is not an error but the expected output from flake8-fixme indicating a 'FIXME' comment. This is the new error code introduced in version 1.0.0.fixAddress the 'FIXME' comment in your code. If you intend to temporarily allow 'FIXME's, you can configure flake8 to ignore the T100 error code in your `.flake8` or `setup.cfg` file (e.g., `ignore = T100`). -
A line like '# FIXME TODO' reports both 'T100' and 'T101' errors.
cause Starting from flake8-fixme 1.0.0, the plugin reports a separate error for each recognized temporary note (FIXME, TODO, XXX) found on a single line.fixThis is the intended behavior. If you want to consolidate these, you must manually rewrite the comment to contain only one keyword per line, or adjust your workflow to handle multiple reports for such lines. Alternatively, you can selectively ignore specific error codes if you only care about certain types of notes.
Warnings
- breaking When upgrading from `flake8-todo` to `flake8-fixme` (version 1.0.0 and above), error codes for different temporary notes have changed. T100 is now for FIXME, T101 for TODO, and T102 for XXX. Additionally, a single line containing multiple keywords (e.g., '# FIXME TODO') will now raise a separate error for each keyword, rather than a single combined error. Python 2.7 support was also dropped.
- gotcha flake8-fixme, like all flake8 plugins, must be installed in the same Python environment as `flake8` itself for it to be discovered and used. If `flake8 --version` does not list `flake8-fixme` as an installed plugin, it means flake8 cannot find it.
- gotcha `flake8-fixme` is a linter, meaning it identifies and reports issues, but it does not automatically fix or modify your code. For automatic code formatting or removal of comments, you would need a separate tool.
Install
-
pip install flake8-fixme
Quickstart
# my_module.py
def some_function():
# FIXME: This needs to be refactored later.
print('Hello, world!') # TODO: Add proper logging
# In your terminal:
# pip install flake8 flake8-fixme
# flake8 my_module.py