[Python-modules-commits] [pylint-common] 01/02: Imported Upstream version 0.2.1
Daniel Stender
danstender-guest at moszumanska.debian.org
Mon Jun 29 06:30:25 UTC 2015
This is an automated email from the git hooks/post-receive script.
danstender-guest pushed a commit to branch master
in repository pylint-common.
commit 128422e5e7dc608d7f46dc439ff5062745dbf24f
Author: Daniel Stender <debian at danielstender.com>
Date: Mon Jun 29 08:26:49 2015 +0200
Imported Upstream version 0.2.1
---
PKG-INFO | 20 ++++++++++++++++
pylint_common.egg-info/PKG-INFO | 20 ++++++++++++++++
pylint_common.egg-info/SOURCES.txt | 10 ++++++++
pylint_common.egg-info/dependency_links.txt | 1 +
pylint_common.egg-info/not-zip-safe | 1 +
pylint_common.egg-info/requires.txt | 3 +++
pylint_common.egg-info/top_level.txt | 1 +
pylint_common/__init__.py | 5 ++++
pylint_common/augmentations.py | 32 +++++++++++++++++++++++++
setup.cfg | 5 ++++
setup.py | 37 +++++++++++++++++++++++++++++
test/test_func.py | 30 +++++++++++++++++++++++
12 files changed, 165 insertions(+)
diff --git a/PKG-INFO b/PKG-INFO
new file mode 100644
index 0000000..44a650b
--- /dev/null
+++ b/PKG-INFO
@@ -0,0 +1,20 @@
+Metadata-Version: 1.1
+Name: pylint-common
+Version: 0.2.1
+Summary: pylint-common is a Pylint plugin to improve Pylint error analysis of thestandard Python library
+Home-page: https://github.com/landscapeio/pylint-common
+Author: landscape.io
+Author-email: code at landscape.io
+License: GPLv2
+Description: UNKNOWN
+Keywords: pylint stdlib plugin
+Platform: UNKNOWN
+Classifier: Development Status :: 4 - Beta
+Classifier: Environment :: Console
+Classifier: Intended Audience :: Developers
+Classifier: Operating System :: Unix
+Classifier: Topic :: Software Development :: Quality Assurance
+Classifier: Programming Language :: Python :: 2.6
+Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: 3.3
+Classifier: Programming Language :: Python :: 3.4
diff --git a/pylint_common.egg-info/PKG-INFO b/pylint_common.egg-info/PKG-INFO
new file mode 100644
index 0000000..44a650b
--- /dev/null
+++ b/pylint_common.egg-info/PKG-INFO
@@ -0,0 +1,20 @@
+Metadata-Version: 1.1
+Name: pylint-common
+Version: 0.2.1
+Summary: pylint-common is a Pylint plugin to improve Pylint error analysis of thestandard Python library
+Home-page: https://github.com/landscapeio/pylint-common
+Author: landscape.io
+Author-email: code at landscape.io
+License: GPLv2
+Description: UNKNOWN
+Keywords: pylint stdlib plugin
+Platform: UNKNOWN
+Classifier: Development Status :: 4 - Beta
+Classifier: Environment :: Console
+Classifier: Intended Audience :: Developers
+Classifier: Operating System :: Unix
+Classifier: Topic :: Software Development :: Quality Assurance
+Classifier: Programming Language :: Python :: 2.6
+Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: 3.3
+Classifier: Programming Language :: Python :: 3.4
diff --git a/pylint_common.egg-info/SOURCES.txt b/pylint_common.egg-info/SOURCES.txt
new file mode 100644
index 0000000..991ecac
--- /dev/null
+++ b/pylint_common.egg-info/SOURCES.txt
@@ -0,0 +1,10 @@
+setup.py
+pylint_common/__init__.py
+pylint_common/augmentations.py
+pylint_common.egg-info/PKG-INFO
+pylint_common.egg-info/SOURCES.txt
+pylint_common.egg-info/dependency_links.txt
+pylint_common.egg-info/not-zip-safe
+pylint_common.egg-info/requires.txt
+pylint_common.egg-info/top_level.txt
+test/test_func.py
\ No newline at end of file
diff --git a/pylint_common.egg-info/dependency_links.txt b/pylint_common.egg-info/dependency_links.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/pylint_common.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/pylint_common.egg-info/not-zip-safe b/pylint_common.egg-info/not-zip-safe
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/pylint_common.egg-info/not-zip-safe
@@ -0,0 +1 @@
+
diff --git a/pylint_common.egg-info/requires.txt b/pylint_common.egg-info/requires.txt
new file mode 100644
index 0000000..d9c5d5c
--- /dev/null
+++ b/pylint_common.egg-info/requires.txt
@@ -0,0 +1,3 @@
+pylint>=1.0
+astroid>=1.0
+pylint-plugin-utils>=0.2.1
\ No newline at end of file
diff --git a/pylint_common.egg-info/top_level.txt b/pylint_common.egg-info/top_level.txt
new file mode 100644
index 0000000..4a2deb9
--- /dev/null
+++ b/pylint_common.egg-info/top_level.txt
@@ -0,0 +1 @@
+pylint_common
diff --git a/pylint_common/__init__.py b/pylint_common/__init__.py
new file mode 100644
index 0000000..413c636
--- /dev/null
+++ b/pylint_common/__init__.py
@@ -0,0 +1,5 @@
+from pylint_common.augmentations import apply_augmentations
+
+
+def register(linter):
+ apply_augmentations(linter)
diff --git a/pylint_common/augmentations.py b/pylint_common/augmentations.py
new file mode 100644
index 0000000..f0b2c56
--- /dev/null
+++ b/pylint_common/augmentations.py
@@ -0,0 +1,32 @@
+from pylint.checkers.base import BasicChecker, astroid
+from pylint_plugin_utils import augment_visit
+
+
+# grumble grumble python3 grumble
+try:
+ BASESTRING = basestring
+except NameError:
+ BASESTRING = str
+
+
+def allow_attribute_comments(chain, node):
+ """
+ This augmentation is to allow comments on class attributes, for example:
+
+ class SomeClass(object):
+ some_attribute = 5
+ ''' This is a docstring for the above attribute '''
+ """
+
+ # TODO: find the relevant citation for why this is the correct way to comment attributes
+ if isinstance(node.previous_sibling(), astroid.Assign) and \
+ isinstance(node.parent, (astroid.Class, astroid.Module)) and \
+ isinstance(node.value, astroid.Const) and \
+ isinstance(node.value.value, BASESTRING):
+ return
+
+ chain()
+
+
+def apply_augmentations(linter):
+ augment_visit(linter, BasicChecker.visit_discard, allow_attribute_comments)
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..861a9f5
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,5 @@
+[egg_info]
+tag_build =
+tag_date = 0
+tag_svn_revision = 0
+
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..1a9f186
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,37 @@
+# -*- coding: UTF-8 -*-
+from distutils.core import setup
+from setuptools import find_packages
+
+
+_version = '0.2.1'
+_packages = find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"])
+
+_short_description = "pylint-common is a Pylint plugin to improve Pylint error analysis of the" \
+ "standard Python library"
+
+_classifiers = (
+ 'Development Status :: 4 - Beta',
+ 'Environment :: Console',
+ 'Intended Audience :: Developers',
+ 'Operating System :: Unix',
+ 'Topic :: Software Development :: Quality Assurance',
+ 'Programming Language :: Python :: 2.6',
+ 'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3.3',
+ 'Programming Language :: Python :: 3.4',
+)
+
+setup(
+ name='pylint-common',
+ url='https://github.com/landscapeio/pylint-common',
+ author='landscape.io',
+ author_email='code at landscape.io',
+ description=_short_description,
+ version=_version,
+ packages=_packages,
+ install_requires=['pylint>=1.0', 'astroid>=1.0', 'pylint-plugin-utils>=0.2.1'],
+ license='GPLv2',
+ classifiers=_classifiers,
+ keywords='pylint stdlib plugin',
+ zip_safe=False # see https://github.com/landscapeio/prospector/issues/18#issuecomment-49857277
+)
diff --git a/test/test_func.py b/test/test_func.py
new file mode 100644
index 0000000..fa9169f
--- /dev/null
+++ b/test/test_func.py
@@ -0,0 +1,30 @@
+
+from os.path import join, dirname, abspath
+import unittest
+from logilab.common import testlib
+from pylint.testutils import make_tests, LintTestUsingModule, LintTestUsingFile, cb_test_gen, linter
+import sys
+
+
+INPUT_DIR = join(dirname(abspath(__file__)), 'input')
+MESSAGES_DIR = join(dirname(abspath(__file__)), 'messages')
+CALLBACKS = [cb_test_gen(LintTestUsingModule), cb_test_gen(LintTestUsingFile)]
+FILTER_RGX = None
+
+
+linter.load_plugin_modules(['pylint_common'])
+linter.global_set_option('required-attributes', ()) # remove required __revision__
+
+
+def suite():
+ return testlib.TestSuite([unittest.makeSuite(test, suiteClass=testlib.TestSuite)
+ for test in make_tests(INPUT_DIR, MESSAGES_DIR,
+ FILTER_RGX, CALLBACKS)])
+
+if __name__=='__main__':
+ if len(sys.argv) > 1:
+ FILTER_RGX = sys.argv[1]
+ del sys.argv[1]
+ testlib.unittest_main(defaultTest='suite')
+
+
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/pylint-common.git
More information about the Python-modules-commits
mailing list