Commit 128422e5 authored by Daniel Stender's avatar Daniel Stender

Imported Upstream version 0.2.1

parents
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@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
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@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
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
pylint>=1.0
astroid>=1.0
pylint-plugin-utils>=0.2.1
\ No newline at end of file
from pylint_common.augmentations import apply_augmentations
def register(linter):
apply_augmentations(linter)
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)
[egg_info]
tag_build =
tag_date = 0
tag_svn_revision = 0
# -*- 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@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
)
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')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment