├── .gitignore ├── LICENSE ├── README.rst ├── flake8_todo.py └── setup.py /.gitignore: -------------------------------------------------------------------------------- 1 | *.egg-info 2 | *.pyc 3 | dist 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Marc Schlaich. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | Flake8 TODO plugin 2 | ================== 3 | 4 | Check for TODO notes. 5 | 6 | This module provides a plugin for ``flake8``, the Python code checker. 7 | 8 | 9 | Installation 10 | ------------ 11 | 12 | You can install or upgrade ``flake8-todo`` with these commands:: 13 | 14 | $ pip install flake8-todo 15 | $ pip install --upgrade flake8-todo 16 | 17 | 18 | Plugin for Flake8 19 | ----------------- 20 | 21 | When both ``flake8 2.0`` and ``flake8-todo`` are installed, the plugin is 22 | available in ``flake8``:: 23 | 24 | $ flake8 --version 25 | 2.0 (pep8: 1.4.5, mccabe: 0.2, flake8-todo: 0.1, pyflakes: 0.6.1) 26 | 27 | 28 | Changes 29 | ------- 30 | 31 | 0.7 - 2016-11-15 32 | ```````````````` 33 | 34 | * Relax dependency pinning 35 | 36 | 37 | 0.6 - 2016-08-11 38 | ```````````````` 39 | 40 | * Fixed entry point for flake8 3.0 41 | 42 | 43 | 0.5 - 2016-07-24 44 | ```````````````` 45 | 46 | * Moved from pep8 to pycodestyle 47 | 48 | 49 | 0.4 - 2015-08-06 50 | ```````````````` 51 | 52 | * Show XXX as TODO entry 53 | 54 | 55 | 0.3 - 2013-04-03 56 | ```````````````` 57 | * Fixed setup for Python 3. 58 | 59 | 60 | 0.2 - 2013-03-26 61 | ```````````````` 62 | * Use unique entry point (previous version conflicted with mccabe) 63 | 64 | 65 | 0.1 - 2013-03-26 66 | ```````````````` 67 | * First release 68 | -------------------------------------------------------------------------------- /flake8_todo.py: -------------------------------------------------------------------------------- 1 | 2 | __version__ = '0.7' 3 | 4 | import re 5 | 6 | import pycodestyle 7 | 8 | NOTE_REGEX = re.compile(r'(TODO|FIXME|XXX)') # noqa 9 | 10 | 11 | def check_todo_notes(physical_line): 12 | if pycodestyle.noqa(physical_line): 13 | return 14 | match = NOTE_REGEX.search(physical_line) 15 | if match: 16 | return match.start(), 'T000 Todo note found.' 17 | 18 | 19 | check_todo_notes.name = name = 'flake8-todo' 20 | check_todo_notes.version = __version__ 21 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | from __future__ import with_statement 4 | from setuptools import setup 5 | 6 | 7 | def get_version(fname='flake8_todo.py'): 8 | with open(fname) as f: 9 | for line in f: 10 | if line.startswith('__version__'): 11 | return eval(line.split('=')[-1]) 12 | 13 | 14 | def get_long_description(): 15 | descr = [] 16 | for fname in ('README.rst',): 17 | with open(fname) as f: 18 | descr.append(f.read()) 19 | return '\n\n'.join(descr) 20 | 21 | 22 | setup( 23 | name='flake8-todo', 24 | version=get_version(), 25 | description="TODO notes checker, plugin for flake8", # noqa 26 | long_description=get_long_description(), 27 | keywords='flake8 todo', 28 | author='Marc Schlaich', 29 | author_email='marc.schlaich@gmail.com', 30 | url='https://github.com/schlamar/flake8-todo', 31 | license='MIT', 32 | py_modules=['flake8_todo'], 33 | install_requires=[ 34 | 'pycodestyle >= 2.0.0, < 3.0.0' 35 | ], 36 | zip_safe=False, 37 | entry_points={ 38 | 'flake8.extension': [ 39 | 'T000 = flake8_todo:check_todo_notes', 40 | ], 41 | }, 42 | classifiers=[ 43 | 'Framework :: Flake8', 44 | 'Development Status :: 4 - Beta', 45 | 'Environment :: Console', 46 | 'Intended Audience :: Developers', 47 | 'License :: OSI Approved :: MIT License', 48 | 'Operating System :: OS Independent', 49 | 'Programming Language :: Python', 50 | 'Programming Language :: Python :: 2', 51 | 'Programming Language :: Python :: 3', 52 | 'Topic :: Software Development :: Libraries :: Python Modules', 53 | 'Topic :: Software Development :: Quality Assurance', 54 | ], 55 | ) 56 | --------------------------------------------------------------------------------