Skip to content

Commit

Permalink
Rename project flint-mccabe to mccabe
Browse files Browse the repository at this point in the history
  • Loading branch information
florentx committed Feb 20, 2013
1 parent d699f87 commit 042653e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 22 deletions.
30 changes: 17 additions & 13 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@ McCabe complexity checker

Ned's script to check McCabe complexity.

This module provides a plugin for ``flint``, the Python code checker.
This module provides a plugin for ``flake8``, the Python code checker.


Installation
------------

You can install, upgrade, uninstall ``flint-mccabe`` with these commands::
You can install, upgrade, uninstall ``mccabe`` with these commands::

$ pip install flint-mccabe
$ pip install --upgrade flint-mccabe
$ pip uninstall flint-mccabe
$ pip install mccabe
$ pip install --upgrade mccabe
$ pip uninstall mccabe


Standalone script
-----------------

The complexity checker can be used directly::

$ python -m flint_mccabe --min 5 flint_mccabe.py
$ python -m mccabe --min 5 mccabe.py
("185:1: 'PathGraphingAstVisitor.visitIf'", 5)
("71:1: 'PathGraph.to_dot'", 5)
("245:1: 'McCabeChecker.run'", 5)
Expand All @@ -30,20 +30,20 @@ The complexity checker can be used directly::
("257:1: 'get_code_complexity'", 5)


Plugin for Flint
----------------
Plugin for Flake8
-----------------

When both ``flint`` and ``flint-mccabe`` are installed, the plugin is
available in ``flint``::
When both ``flake8`` and ``mccabe`` are installed, the plugin is
available in ``flake8``::

$ flint --version
0.1 (pep8: 1.4.2, pyflakes: 0.6.1, mccabe: 0.1)
$ flake8 --version
2.0 (pep8: 1.4.2, pyflakes: 0.6.1, mccabe: 0.2)

By default the plugin is disabled. Use the ``--max-complexity`` switch to
enable it. It will emit a warning if the McCabe complexity of a function is
higher that the value::

$ flint --max-complexity 10 coolproject
$ flake8 --max-complexity 10 coolproject
...
coolproject/mod.py:1204:1: C901 'CoolFactory.prepare' is too complex (14)

Expand All @@ -66,6 +66,10 @@ Changes
0.2 - unreleased
````````````````

* Rename project ``flint-mccabe`` to ``mccabe``.

* Provide ``flake8.extension`` setuptools entry point.

* Read ``max-complexity`` from the configuration file.

* Rename argument ``min_complexity`` to ``threshold``.
Expand Down
2 changes: 1 addition & 1 deletion flint_mccabe.py → mccabe.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import ast
from ast import iter_child_nodes
except ImportError: # Python 2.5
from flint.util import ast, iter_child_nodes
from flake8.util import ast, iter_child_nodes

__version__ = '0.2a0'

Expand Down
16 changes: 8 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from setuptools import setup


def get_version(fname='flint_mccabe.py'):
def get_version(fname='mccabe.py'):
with open(fname) as f:
for line in f:
if line.startswith('__version__'):
Expand All @@ -19,23 +19,23 @@ def get_long_description():


setup(
name='flint-mccabe',
name='mccabe',
version=get_version(),
description="McCabe checker, plugin for flint",
description="McCabe checker, plugin for flake8",
long_description=get_long_description(),
keywords='flint mccabe',
keywords='flake8 mccabe',
author='Florent Xicluna',
author_email='florent.xicluna@gmail.com',
url='https://github.com/flintwork/flint-mccabe',
url='https://github.com/florentx/mccabe',
license='Expat license',
py_modules=['flint_mccabe'],
py_modules=['mccabe'],
zip_safe=False,
install_requires=[
'setuptools',
],
entry_points={
'flint.extension': [
'C90 = flint_mccabe:McCabeChecker',
'flake8.extension': [
'C90 = mccabe:McCabeChecker',
],
},
classifiers=[
Expand Down

0 comments on commit 042653e

Please sign in to comment.