[Python-modules-commits] [python-mccabe] 01/03: Import python-mccabe_0.5.3.orig.tar.gz
Ondřej Nový
onovy at moszumanska.debian.org
Tue Feb 21 09:49:15 UTC 2017
This is an automated email from the git hooks/post-receive script.
onovy pushed a commit to branch master
in repository python-mccabe.
commit f32cd0ac41a7614914a1a8eb7267ca3990af0a16
Author: Ondřej Nový <onovy at debian.org>
Date: Thu Dec 29 14:52:57 2016 +0100
Import python-mccabe_0.5.3.orig.tar.gz
---
PKG-INFO | 7 ++++++-
README.rst | 5 +++++
mccabe.egg-info/PKG-INFO | 7 ++++++-
mccabe.py | 13 +++++++------
4 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/PKG-INFO b/PKG-INFO
index 19364d8..cfdfbaa 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: mccabe
-Version: 0.5.2
+Version: 0.5.3
Summary: McCabe checker, plugin for flake8
Home-page: https://github.com/pycqa/mccabe
Author: Ian Cordasco
@@ -73,6 +73,11 @@ Description: McCabe complexity checker
Changes
-------
+ 0.5.3 - 2016-12-14
+ ``````````````````
+
+ * Report actual column number of violation instead of the start of the line
+
0.5.2 - 2016-07-31
``````````````````
diff --git a/README.rst b/README.rst
index d9401d1..874b0eb 100644
--- a/README.rst
+++ b/README.rst
@@ -65,6 +65,11 @@ Links
Changes
-------
+0.5.3 - 2016-12-14
+``````````````````
+
+* Report actual column number of violation instead of the start of the line
+
0.5.2 - 2016-07-31
``````````````````
diff --git a/mccabe.egg-info/PKG-INFO b/mccabe.egg-info/PKG-INFO
index 19364d8..cfdfbaa 100644
--- a/mccabe.egg-info/PKG-INFO
+++ b/mccabe.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: mccabe
-Version: 0.5.2
+Version: 0.5.3
Summary: McCabe checker, plugin for flake8
Home-page: https://github.com/pycqa/mccabe
Author: Ian Cordasco
@@ -73,6 +73,11 @@ Description: McCabe complexity checker
Changes
-------
+ 0.5.3 - 2016-12-14
+ ``````````````````
+
+ * Report actual column number of violation instead of the start of the line
+
0.5.2 - 2016-07-31
``````````````````
diff --git a/mccabe.py b/mccabe.py
index c40381a..305fb94 100644
--- a/mccabe.py
+++ b/mccabe.py
@@ -16,7 +16,7 @@ try:
except ImportError: # Python 2.5
from flake8.util import ast, iter_child_nodes
-__version__ = '0.5.2'
+__version__ = '0.5.3'
class ASTVisitor(object):
@@ -61,10 +61,11 @@ class PathNode(object):
class PathGraph(object):
- def __init__(self, name, entity, lineno):
+ def __init__(self, name, entity, lineno, column=0):
self.name = name
self.entity = entity
self.lineno = lineno
+ self.column = column
self.nodes = defaultdict(list)
def connect(self, n1, n2):
@@ -116,7 +117,7 @@ class PathGraphingAstVisitor(ASTVisitor):
else:
entity = node.name
- name = '%d:1: %r' % (node.lineno, entity)
+ name = '%d:%d: %r' % (node.lineno, node.col_offset, entity)
if self.graph is not None:
# closure
@@ -128,7 +129,7 @@ class PathGraphingAstVisitor(ASTVisitor):
self.graph.connect(pathnode, bottom)
self.tail = bottom
else:
- self.graph = PathGraph(name, entity, node.lineno)
+ self.graph = PathGraph(name, entity, node.lineno, node.col_offset)
pathnode = PathNode(name)
self.tail = pathnode
self.dispatch_list(node.body)
@@ -178,7 +179,7 @@ class PathGraphingAstVisitor(ASTVisitor):
"""create the subgraphs representing any `if` and `for` statements"""
if self.graph is None:
# global loop
- self.graph = PathGraph(name, name, node.lineno)
+ self.graph = PathGraph(name, name, node.lineno, node.col_offset)
pathnode = PathNode(name)
self._subgraph_parse(node, pathnode, extra_blocks)
self.graphs["%s%s" % (self.classname, name)] = self.graph
@@ -265,7 +266,7 @@ class McCabeChecker(object):
for graph in visitor.graphs.values():
if graph.complexity() > self.max_complexity:
text = self._error_tmpl % (graph.entity, graph.complexity())
- yield graph.lineno, 0, text, type(self)
+ yield graph.lineno, graph.column, text, type(self)
def get_code_complexity(code, threshold=7, filename='stdin'):
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-mccabe.git
More information about the Python-modules-commits
mailing list