[Python-modules-commits] [pylama] 01/05: Import pylama_7.1.0.orig.tar.gz
ChangZhuo Chen
czchen at moszumanska.debian.org
Tue Dec 6 06:04:19 UTC 2016
This is an automated email from the git hooks/post-receive script.
czchen pushed a commit to branch master
in repository pylama.
commit 5521c64d75989649b421b092446c2d62d40897ed
Author: ChangZhuo Chen (陳昌倬) <czchen at debian.org>
Date: Fri Sep 9 16:25:28 2016 +0800
Import pylama_7.1.0.orig.tar.gz
---
AUTHORS | 4 ++--
PKG-INFO | 24 +++++++++++-----------
README.rst | 20 +++++++++---------
pylama.egg-info/PKG-INFO | 24 +++++++++++-----------
pylama.egg-info/SOURCES.txt | 2 +-
pylama.egg-info/requires.txt | 6 +++---
pylama/__init__.py | 2 +-
pylama/config.py | 17 +++++++--------
pylama/core.py | 3 ++-
pylama/errors.py | 13 +++++++++---
pylama/lint/extensions.py | 5 +++--
pylama/lint/pylama_mccabe.py | 5 +----
.../{pylama_pep257.py => pylama_pydocstyle.py} | 10 ++++-----
pylama/lint/pylama_pyflakes.py | 1 +
pylama/main.py | 7 +++++--
requirements.txt | 8 ++++----
setup.py | 2 +-
17 files changed, 82 insertions(+), 71 deletions(-)
diff --git a/AUTHORS b/AUTHORS
index 4efb9ba..2d853c0 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -10,9 +10,9 @@ Contributors:
* Daniel O'onnell' (https://github.com/mruwnik)
* Fábio C. Barrionuevo da Luz (https://github.com/luzfcb)
* Grzegorz Śliwiński (https://github.com/fizyk)
-* Grzegorz Śliwiński (https://github.com/fizyk)
-* Jarek Śmiejczak (https://github.com/jarekps)
+* Jarek Śmiejczak (https://github.com/jotes)
* Jens Persson (https://github.com/MrShark)
* Johan Bloemberg (https://github.com/aequitas)
+* Serg Baburin (https://github.com/gmist)
* Tomasz Karbownicki (https://github.com/trojkat)
* lukaszpiotr (https://github.com/lukaszpiotr)
diff --git a/PKG-INFO b/PKG-INFO
index e7e8da9..f741092 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pylama
-Version: 7.0.9
+Version: 7.1.0
Summary: pylama -- Code audit tool for python
Home-page: http://github.com/klen/pylama
@@ -15,7 +15,7 @@ Description: |logo| Pylama
Code audit tool for Python and JavaScript. Pylama wraps these tools:
* PEP8_ © 2012-2013, Florent Xicluna;
- * PEP257_ © 2012, GreenSteam, <http://greensteam.dk/>
+ * pydocstyle_ (formerly pep257 by Vladimir Keleshev) © 2014, Amir Rachum;
* PyFlakes_ © 2005-2013, Kevin Watters;
* Mccabe_ © Ned Batchelder;
* Pylint_ © 2013, Logilab (should be installed 'pylama_pylint' module);
@@ -117,12 +117,12 @@ Description: |logo| Pylama
[--ignore IGNORE] [--skip SKIP] [--report REPORT] [--hook]
[--async] [--options OPTIONS] [--force] [--abspath]
[paths [paths ...]]
-
+
Code audit tool for python.
-
+
positional arguments:
paths Paths to files or directories for code check.
-
+
optional arguments:
-h, --help show this help message and exit
--verbose, -v Verbose mode.
@@ -134,7 +134,7 @@ Description: |logo| Pylama
--sort SORT Sort result by error types. Ex. E,W,D
--linters LINTERS, -l LINTERS
Select linters. (comma-separated). Choices are
- mccabe,pep8,pyflakes,pep257.
+ mccabe,pep8,pyflakes,pydocstyle.
--ignore IGNORE, -i IGNORE
Ignore errors and warnings. (comma-separated)
--skip SKIP Skip files by masks (comma-separated, Ex.
@@ -271,7 +271,7 @@ Description: |logo| Pylama
pytest --pylama ...
- Recomended way to settings pyalam options when using pytest — configuration
+ Recomended way to settings pylama options when using pytest — configuration
files (see below).
@@ -289,7 +289,7 @@ Description: |logo| Pylama
'pylama.linter': ['lintername = pylama_lintername.main:Linter'],
}
# ...
- )
+ )
'Linter' should be instance of 'pylama.lint.Linter' class.
Must implemented two methods:
@@ -311,7 +311,7 @@ Description: |logo| Pylama
'pylama.linter': ['wow = pylama_wow.main:Linter'],
}
# ...
- )
+ )
pylama_wow.py: ::
@@ -379,10 +379,10 @@ Description: |logo| Pylama
.. _links:
- .. _AUTHORS: https://github.com/klen/pylama/blob/develop/AUTHORS
+ .. _AUTHORS: https://github.com/klen/pylama/blob/develop/AUTHORS
.. _BSD license: http://www.linfo.org/bsdlicense.html
.. _Mccabe: http://nedbatchelder.com/blog/200803/python_code_complexity_microtool.html
- .. _PEP257: https://github.com/GreenSteam/pep257
+ .. _pydocstyle: https://github.com/PyCQA/pydocstyle/
.. _PEP8: https://github.com/jcrocholl/pep8
.. _PyFlakes: https://github.com/pyflakes/pyflakes
.. _Pylint: http://pylint.org
@@ -392,7 +392,7 @@ Description: |logo| Pylama
.. |logo| image:: https://raw.github.com/klen/pylama/develop/docs/_static/logo.png
:width: 100
-Keywords: pylint,pep8,pyflakes,mccabe,linter,qa,pep257
+Keywords: pylint,pep8,pyflakes,mccabe,linter,qa,pep257,pydocstyle
Platform: Any
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Quality Assurance
diff --git a/README.rst b/README.rst
index 939fc00..8e2ffae 100644
--- a/README.rst
+++ b/README.rst
@@ -6,7 +6,7 @@
Code audit tool for Python and JavaScript. Pylama wraps these tools:
* PEP8_ © 2012-2013, Florent Xicluna;
-* PEP257_ © 2012, GreenSteam, <http://greensteam.dk/>
+* pydocstyle_ (formerly pep257 by Vladimir Keleshev) © 2014, Amir Rachum;
* PyFlakes_ © 2005-2013, Kevin Watters;
* Mccabe_ © Ned Batchelder;
* Pylint_ © 2013, Logilab (should be installed 'pylama_pylint' module);
@@ -108,12 +108,12 @@ Command line options
[--ignore IGNORE] [--skip SKIP] [--report REPORT] [--hook]
[--async] [--options OPTIONS] [--force] [--abspath]
[paths [paths ...]]
-
+
Code audit tool for python.
-
+
positional arguments:
paths Paths to files or directories for code check.
-
+
optional arguments:
-h, --help show this help message and exit
--verbose, -v Verbose mode.
@@ -125,7 +125,7 @@ Command line options
--sort SORT Sort result by error types. Ex. E,W,D
--linters LINTERS, -l LINTERS
Select linters. (comma-separated). Choices are
- mccabe,pep8,pyflakes,pep257.
+ mccabe,pep8,pyflakes,pydocstyle.
--ignore IGNORE, -i IGNORE
Ignore errors and warnings. (comma-separated)
--skip SKIP Skip files by masks (comma-separated, Ex.
@@ -262,7 +262,7 @@ Check files with pylama ::
pytest --pylama ...
-Recomended way to settings pyalam options when using pytest — configuration
+Recomended way to settings pylama options when using pytest — configuration
files (see below).
@@ -280,7 +280,7 @@ In 'setup.py' should be defined 'pylama.linter' entry point. ::
'pylama.linter': ['lintername = pylama_lintername.main:Linter'],
}
# ...
- )
+ )
'Linter' should be instance of 'pylama.lint.Linter' class.
Must implemented two methods:
@@ -302,7 +302,7 @@ setup.py: ::
'pylama.linter': ['wow = pylama_wow.main:Linter'],
}
# ...
- )
+ )
pylama_wow.py: ::
@@ -370,10 +370,10 @@ Licensed under a `BSD license`_.
.. _links:
-.. _AUTHORS: https://github.com/klen/pylama/blob/develop/AUTHORS
+.. _AUTHORS: https://github.com/klen/pylama/blob/develop/AUTHORS
.. _BSD license: http://www.linfo.org/bsdlicense.html
.. _Mccabe: http://nedbatchelder.com/blog/200803/python_code_complexity_microtool.html
-.. _PEP257: https://github.com/GreenSteam/pep257
+.. _pydocstyle: https://github.com/PyCQA/pydocstyle/
.. _PEP8: https://github.com/jcrocholl/pep8
.. _PyFlakes: https://github.com/pyflakes/pyflakes
.. _Pylint: http://pylint.org
diff --git a/pylama.egg-info/PKG-INFO b/pylama.egg-info/PKG-INFO
index e7e8da9..f741092 100644
--- a/pylama.egg-info/PKG-INFO
+++ b/pylama.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pylama
-Version: 7.0.9
+Version: 7.1.0
Summary: pylama -- Code audit tool for python
Home-page: http://github.com/klen/pylama
@@ -15,7 +15,7 @@ Description: |logo| Pylama
Code audit tool for Python and JavaScript. Pylama wraps these tools:
* PEP8_ © 2012-2013, Florent Xicluna;
- * PEP257_ © 2012, GreenSteam, <http://greensteam.dk/>
+ * pydocstyle_ (formerly pep257 by Vladimir Keleshev) © 2014, Amir Rachum;
* PyFlakes_ © 2005-2013, Kevin Watters;
* Mccabe_ © Ned Batchelder;
* Pylint_ © 2013, Logilab (should be installed 'pylama_pylint' module);
@@ -117,12 +117,12 @@ Description: |logo| Pylama
[--ignore IGNORE] [--skip SKIP] [--report REPORT] [--hook]
[--async] [--options OPTIONS] [--force] [--abspath]
[paths [paths ...]]
-
+
Code audit tool for python.
-
+
positional arguments:
paths Paths to files or directories for code check.
-
+
optional arguments:
-h, --help show this help message and exit
--verbose, -v Verbose mode.
@@ -134,7 +134,7 @@ Description: |logo| Pylama
--sort SORT Sort result by error types. Ex. E,W,D
--linters LINTERS, -l LINTERS
Select linters. (comma-separated). Choices are
- mccabe,pep8,pyflakes,pep257.
+ mccabe,pep8,pyflakes,pydocstyle.
--ignore IGNORE, -i IGNORE
Ignore errors and warnings. (comma-separated)
--skip SKIP Skip files by masks (comma-separated, Ex.
@@ -271,7 +271,7 @@ Description: |logo| Pylama
pytest --pylama ...
- Recomended way to settings pyalam options when using pytest — configuration
+ Recomended way to settings pylama options when using pytest — configuration
files (see below).
@@ -289,7 +289,7 @@ Description: |logo| Pylama
'pylama.linter': ['lintername = pylama_lintername.main:Linter'],
}
# ...
- )
+ )
'Linter' should be instance of 'pylama.lint.Linter' class.
Must implemented two methods:
@@ -311,7 +311,7 @@ Description: |logo| Pylama
'pylama.linter': ['wow = pylama_wow.main:Linter'],
}
# ...
- )
+ )
pylama_wow.py: ::
@@ -379,10 +379,10 @@ Description: |logo| Pylama
.. _links:
- .. _AUTHORS: https://github.com/klen/pylama/blob/develop/AUTHORS
+ .. _AUTHORS: https://github.com/klen/pylama/blob/develop/AUTHORS
.. _BSD license: http://www.linfo.org/bsdlicense.html
.. _Mccabe: http://nedbatchelder.com/blog/200803/python_code_complexity_microtool.html
- .. _PEP257: https://github.com/GreenSteam/pep257
+ .. _pydocstyle: https://github.com/PyCQA/pydocstyle/
.. _PEP8: https://github.com/jcrocholl/pep8
.. _PyFlakes: https://github.com/pyflakes/pyflakes
.. _Pylint: http://pylint.org
@@ -392,7 +392,7 @@ Description: |logo| Pylama
.. |logo| image:: https://raw.github.com/klen/pylama/develop/docs/_static/logo.png
:width: 100
-Keywords: pylint,pep8,pyflakes,mccabe,linter,qa,pep257
+Keywords: pylint,pep8,pyflakes,mccabe,linter,qa,pep257,pydocstyle
Platform: Any
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Quality Assurance
diff --git a/pylama.egg-info/SOURCES.txt b/pylama.egg-info/SOURCES.txt
index 9a0f713..b8b1351 100644
--- a/pylama.egg-info/SOURCES.txt
+++ b/pylama.egg-info/SOURCES.txt
@@ -28,6 +28,6 @@ pylama/libs/inirama.py
pylama/lint/__init__.py
pylama/lint/extensions.py
pylama/lint/pylama_mccabe.py
-pylama/lint/pylama_pep257.py
pylama/lint/pylama_pep8.py
+pylama/lint/pylama_pydocstyle.py
pylama/lint/pylama_pyflakes.py
\ No newline at end of file
diff --git a/pylama.egg-info/requires.txt b/pylama.egg-info/requires.txt
index 6c3c007..d1662e6 100644
--- a/pylama.egg-info/requires.txt
+++ b/pylama.egg-info/requires.txt
@@ -1,4 +1,4 @@
-mccabe >= 0.4.0
-pep257 >= 0.7.0
+mccabe >= 0.5.2
+pydocstyle >= 1.0.0
pep8 >= 1.7.0
-pyflakes >= 1.0.0
+pyflakes >= 1.3.0
diff --git a/pylama/__init__.py b/pylama/__init__.py
index 533328f..c1e6c34 100644
--- a/pylama/__init__.py
+++ b/pylama/__init__.py
@@ -5,7 +5,7 @@ Code audit tool for python.
:license: BSD, see LICENSE for more details.
"""
-__version__ = "7.0.9"
+__version__ = "7.1.0"
__project__ = "pylama"
__author__ = "Kirill Klenov <horneds at gmail.com>"
__license__ = "GNU LGPL"
diff --git a/pylama/config.py b/pylama/config.py
index e60fb45..46da225 100644
--- a/pylama/config.py
+++ b/pylama/config.py
@@ -43,14 +43,14 @@ class _Default(object):
def split_csp_str(s):
- """ Split commaseparated string.
+ """ Split comma separated string into unique values, keeping their order.
:returns: list of splitted values
"""
- if isinstance(s, (list, tuple)):
- return s
- return list(set(i for i in s.strip().split(',') if i))
+ seen = set()
+ l = s if isinstance(s, (list, tuple)) else s.strip().split(',')
+ return [x for x in l if x and not (x in seen or seen.add(x))]
def parse_linters(linters):
@@ -81,8 +81,9 @@ PARSER.add_argument('--version', action='version',
version='%(prog)s ' + __version__)
PARSER.add_argument(
- "--format", "-f", default=_Default('pep8'), choices=['pep8', 'pylint'],
- help="Choose errors format (pep8, pylint).")
+ "--format", "-f", default=_Default('pep8'),
+ choices=['pep8', 'pylint', 'parsable'],
+ help="Choose errors format (pep8, pylint, parsable).")
PARSER.add_argument(
"--select", "-s", default=_Default(''), type=split_csp_str,
@@ -183,8 +184,8 @@ def parse_options(args=None, config=True, rootdir=CURDIR, **overrides): # noqa
options.file_params[mask] = dict(opts)
# Postprocess options
- opts = dict(options.__dict__.items())
- for name, value in opts.items():
+ for name in options.__dict__:
+ value = getattr(options, name)
if isinstance(value, _Default):
setattr(options, name, process_value(name, value.value))
diff --git a/pylama/core.py b/pylama/core.py
index faecad3..d68f6a9 100644
--- a/pylama/core.py
+++ b/pylama/core.py
@@ -73,7 +73,8 @@ def run(path='', code=None, rootdir=CURDIR, options=None):
except SyntaxError as e:
LOGGER.debug("SyntaxError %s", e)
errors.append(
- Error(linter=lname, lnum=e.lineno, col=e.offset, text=e.args[0],
+ Error(linter='pylama', lnum=e.lineno, col=e.offset,
+ text='E0100 SyntaxError: {}'.format(e.args[0]),
filename=path))
except Exception as e: # noqa
diff --git a/pylama/errors.py b/pylama/errors.py
index 7f6c0a1..71d13e9 100644
--- a/pylama/errors.py
+++ b/pylama/errors.py
@@ -1,8 +1,11 @@
""" Don't duplicate same errors from different linters. """
-
+import re
from collections import defaultdict
+PATTERN_NUMBER = re.compile(r'^[A-Z]\d+$')
+
+
DUPLICATES = (
# multiple statements on one line
@@ -48,6 +51,7 @@ DUPLICATES = (
[('pylint', 'W00401'), ('pyflakes', 'W0401')],
# module docstring
+ [('pydocstyle', 'D100'), ('pylint', 'C0111')],
[('pep257', 'D100'), ('pylint', 'C0111')],
)
@@ -72,12 +76,15 @@ class Error(object):
""" Store an error's information. """
def __init__(self, linter="", col=1, lnum=1, type="E",
- text="unknown error", filename="", **kwargs):
+ text="unknown error", filename="", number="", **kwargs):
""" Init error information with default values. """
text = ' '.join(str(text).strip().split('\n'))
if linter:
text = "%s [%s]" % (text, linter)
- number = text.split(' ', 1)[0]
+ number = number or text.split(' ', 1)[0]
+ if not PATTERN_NUMBER.match(number):
+ number = ""
+
self._info = dict(linter=linter, col=col, lnum=lnum, type=type[:1],
text=text, filename=filename, number=number)
diff --git a/pylama/lint/extensions.py b/pylama/lint/extensions.py
index bfd83d8..662d6ee 100644
--- a/pylama/lint/extensions.py
+++ b/pylama/lint/extensions.py
@@ -9,8 +9,9 @@ except ImportError:
pass
try:
- from pylama.lint.pylama_pep257 import Linter
- LINTERS['pep257'] = Linter()
+ from pylama.lint.pylama_pydocstyle import Linter
+ LINTERS['pep257'] = Linter() # for compatibility
+ LINTERS['pydocstyle'] = Linter()
except ImportError:
pass
diff --git a/pylama/lint/pylama_mccabe.py b/pylama/lint/pylama_mccabe.py
index fc19100..4c4f525 100644
--- a/pylama/lint/pylama_mccabe.py
+++ b/pylama/lint/pylama_mccabe.py
@@ -15,10 +15,7 @@ class Linter(Abstract):
:return list: List of errors.
"""
- try:
- tree = compile(code, path, "exec", ast.PyCF_ONLY_AST)
- except SyntaxError as exc:
- return [{'lnum': exc.lineno, 'text': 'Invalid syntax: %s' % exc.text.strip()}]
+ tree = compile(code, path, "exec", ast.PyCF_ONLY_AST)
McCabeChecker.max_complexity = int(params.get('complexity', 10))
return [
diff --git a/pylama/lint/pylama_pep257.py b/pylama/lint/pylama_pydocstyle.py
similarity index 55%
rename from pylama/lint/pylama_pep257.py
rename to pylama/lint/pylama_pydocstyle.py
index 5e1f785..33d94f7 100644
--- a/pylama/lint/pylama_pep257.py
+++ b/pylama/lint/pylama_pydocstyle.py
@@ -1,21 +1,21 @@
-"""PEP257 support."""
+"""pydocstyle support."""
-from pep257 import PEP257Checker
+from pydocstyle import PEP257Checker
from pylama.lint import Linter as Abstract
class Linter(Abstract):
- """Check PEP257 errors."""
+ """Check pydocstyle errors."""
@staticmethod
def run(path, code=None, **meta):
- """PEP257 code checking.
+ """pydocstyle code checking.
:return list: List of errors.
"""
return [
- {'lnum': e.line, 'text': e.message, 'type': 'D'}
+ {'lnum': e.line, 'text': e.message, 'type': 'D', 'number': e.code}
for e in PEP257Checker().check_source(code, path)
]
diff --git a/pylama/lint/pylama_pyflakes.py b/pylama/lint/pylama_pyflakes.py
index 184d969..61d1e8b 100644
--- a/pylama/lint/pylama_pyflakes.py
+++ b/pylama/lint/pylama_pyflakes.py
@@ -10,6 +10,7 @@ checker.messages.RedefinedWhileUnused.message = "W0404 redefinition of unused %r
checker.messages.RedefinedInListComp.message = "W0621 list comprehension redefines %r from line %r"
checker.messages.ImportShadowedByLoopVar.message = "W0621 import %r from line %r shadowed by loop variable"
checker.messages.ImportStarUsed.message = "W0401 'from %s import *' used; unable to detect undefined names"
+checker.messages.ImportStarUsage.message = "W0401 '%s may be undefined, or defined from star imports: %s'"
checker.messages.UndefinedName.message = "E0602 undefined name %r"
checker.messages.DoctestSyntaxError.message = "W0511 syntax error in doctest"
checker.messages.UndefinedExport.message = "E0603 undefined name %r in __all__"
diff --git a/pylama/main.py b/pylama/main.py
index 96ab1c5..b343e1e 100644
--- a/pylama/main.py
+++ b/pylama/main.py
@@ -81,9 +81,12 @@ def process_paths(options, candidates=None, error=True):
"""Process files and log errors."""
errors = check_path(options, rootdir=CURDIR, candidates=candidates)
- pattern = "%(filename)s:%(lnum)s:%(col)s: %(text)s"
- if options.format == 'pylint':
+ if options.format == 'pep8':
+ pattern = "%(filename)s:%(lnum)s:%(col)s: %(text)s"
+ elif options.format == 'pylint':
pattern = "%(filename)s:%(lnum)s: [%(type)s] %(text)s"
+ else: # 'parsable'
+ pattern = "%(filename)s:%(lnum)s:%(col)s: [%(type)s] %(text)s"
for er in errors:
if options.abspath:
diff --git a/requirements.txt b/requirements.txt
index de74d15..daca762 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,6 +1,6 @@
# Test requirements
-mccabe == 0.4.0
-pep257 == 0.7.0
-pep8 == 1.7.0
-pyflakes == 1.0.0
+mccabe >= 0.5.2
+pydocstyle >= 1.0.0
+pep8 >= 1.7.0
+pyflakes >= 1.3.0
diff --git a/setup.py b/setup.py
index d416ac7..60273fd 100644
--- a/setup.py
+++ b/setup.py
@@ -32,7 +32,7 @@ meta = dict(
long_description=_read('README.rst'),
platforms=('Any'),
zip_safe=False,
- keywords='pylint pep8 pyflakes mccabe linter qa pep257'.split(),
+ keywords='pylint pep8 pyflakes mccabe linter qa pep257 pydocstyle'.split(),
author='Kirill Klenov',
author_email='horneds at gmail.com',
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/pylama.git
More information about the Python-modules-commits
mailing list