Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit70d6bf5

Browse files
committed
Update pylint.
1 parentc9e357c commit70d6bf5

File tree

982 files changed

+11623
-58790
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

982 files changed

+11623
-58790
lines changed

‎Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ pylama:
5454
@pip install --upgrade --force-reinstall --target=$(LIBS) pycodestyle
5555
@pip install --upgrade --force-reinstall --target=$(LIBS) pyflakes
5656
@pip install --upgrade --force-reinstall --target=$(LIBS) mccabe
57-
@find$(LIBS)/*.dist-info| xargs rm -rf
57+
@pip install --upgrade --force-reinstall --target=$(LIBS) pylint
58+
@find$(LIBS) -name*.dist-info -type d| xargs rm -rf
59+
@find$(LIBS) -name*.egg-info -type d| xargs rm -rf
60+
@find$(LIBS) -name test* -type d| xargs rm -rf
5861

5962
.PHONY: rope
6063
rope:

‎pymode/libs/astroid/__init__.py

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
1-
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
2-
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
3-
#
4-
# This file is part of astroid.
5-
#
6-
# astroid is free software: you can redistribute it and/or modify it
7-
# under the terms of the GNU Lesser General Public License as published by the
8-
# Free Software Foundation, either version 2.1 of the License, or (at your
9-
# option) any later version.
10-
#
11-
# astroid is distributed in the hope that it will be useful, but
12-
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
14-
# for more details.
15-
#
16-
# You should have received a copy of the GNU Lesser General Public License along
17-
# with astroid. If not, see <http://www.gnu.org/licenses/>.
1+
# Copyright (c) 2006-2013, 2015 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
2+
# Copyright (c) 2014 Google, Inc.
3+
# Copyright (c) 2015-2016 Claudiu Popa <pcmanticore@gmail.com>
4+
5+
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
6+
# For details: https://github.com/PyCQA/astroid/blob/master/COPYING.LESSER
7+
188
"""Python Abstract Syntax Tree New Generation
199
2010
The aim of this module is to provide a common base representation of
@@ -39,14 +29,27 @@
3929
4030
* builder contains the class responsible to build astroid trees
4131
"""
42-
__doctype__="restructuredtext en"
4332

33+
importos
4434
importsys
4535
importre
4636
fromoperatorimportattrgetter
4737

38+
importenum
39+
40+
41+
_Context=enum.Enum('Context','Load Store Del')
42+
Load=_Context.Load
43+
Store=_Context.Store
44+
Del=_Context.Del
45+
del_Context
46+
47+
48+
from .__pkginfo__importversionas__version__
4849
# WARNING: internal imports order matters !
4950

51+
# pylint: disable=redefined-builtin, wildcard-import
52+
5053
# make all exception classes accessible from astroid package
5154
fromastroid.exceptionsimport*
5255

@@ -58,22 +61,21 @@
5861

5962
# more stuff available
6063
fromastroidimportraw_building
61-
fromastroid.basesimportInstance,BoundMethod,UnboundMethod
64+
fromastroid.basesimportBaseInstance,Instance,BoundMethod,UnboundMethod
6265
fromastroid.node_classesimportare_exclusive,unpack_infer
6366
fromastroid.scoped_nodesimportbuiltin_lookup
64-
fromastroid.builderimportparse
65-
fromastroid.utilimportYES
67+
fromastroid.builderimportparse,extract_node
68+
fromastroid.utilimportUninferable,YES
6669

67-
# make a manager instance (borg) as well as Project and Package classes
68-
# accessible from astroid package
70+
# make a manager instance (borg) accessible from astroid package
6971
fromastroid.managerimportAstroidManager
7072
MANAGER=AstroidManager()
7173
delAstroidManager
7274

7375
# transform utilities (filters and decorator)
7476

7577
classAsStringRegexpPredicate(object):
76-
"""Class to be used as predicate that may be given to `register_transform`
78+
"""ClassDef to be used as predicate that may be given to `register_transform`
7779
7880
First argument is a regular expression that will be searched against the `as_string`
7981
representation of the node onto which it's applied.
@@ -92,6 +94,7 @@ def __init__(self, regexp, expression=None):
9294
def__call__(self,node):
9395
ifself.expressionisnotNone:
9496
node=attrgetter(self.expression)(node)
97+
# pylint: disable=no-member; github.com/pycqa/astroid/126
9598
returnself.regexp.search(node.as_string())
9699

97100
definference_tip(infer_function):
@@ -114,8 +117,8 @@ def transform(node, infer_function=infer_function):
114117
defregister_module_extender(manager,module_name,get_extension_mod):
115118
deftransform(node):
116119
extension_module=get_extension_mod()
117-
forname,objsinextension_module._locals.items():
118-
node._locals[name]=objs
120+
forname,objsinextension_module.locals.items():
121+
node.locals[name]=objs
119122
forobjinobjs:
120123
ifobj.parentisextension_module:
121124
obj.parent=node
@@ -124,13 +127,11 @@ def transform(node):
124127

125128

126129
# load brain plugins
127-
fromosimportlistdir
128-
fromos.pathimportjoin,dirname
129-
BRAIN_MODULES_DIR=join(dirname(__file__),'brain')
130+
BRAIN_MODULES_DIR=os.path.join(os.path.dirname(__file__),'brain')
130131
ifBRAIN_MODULES_DIRnotinsys.path:
131132
# add it to the end of the list so user path take precedence
132133
sys.path.append(BRAIN_MODULES_DIR)
133134
# load modules in this directory
134-
formoduleinlistdir(BRAIN_MODULES_DIR):
135+
formoduleinos.listdir(BRAIN_MODULES_DIR):
135136
ifmodule.endswith('.py'):
136137
__import__(module[:-3])

‎pymode/libs/astroid/__pkginfo__.py

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,49 @@
1-
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
2-
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
3-
#
4-
# This file is part of astroid.
5-
#
6-
# astroid is free software: you can redistribute it and/or modify it
7-
# under the terms of the GNU Lesser General Public License as published by the
8-
# Free Software Foundation, either version 2.1 of the License, or (at your
9-
# option) any later version.
10-
#
11-
# astroid is distributed in the hope that it will be useful, but
12-
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13-
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
14-
# for more details.
15-
#
16-
# You should have received a copy of the GNU Lesser General Public License along
17-
# with astroid. If not, see <http://www.gnu.org/licenses/>.
1+
# Copyright (c) 2006-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
2+
# Copyright (c) 2014-2016 Claudiu Popa <pcmanticore@gmail.com>
3+
# Copyright (c) 2014 Google, Inc.
4+
5+
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
6+
# For details: https://github.com/PyCQA/astroid/blob/master/COPYING.LESSER
7+
188
"""astroid packaging information"""
9+
10+
fromsysimportversion_infoaspy_version
11+
12+
frompkg_resourcesimportparse_version
13+
fromsetuptoolsimport__version__assetuptools_version
14+
1915
distname='astroid'
2016

2117
modname='astroid'
2218

23-
numversion= (1,4,9)
24-
version='.'.join([str(num)fornuminnumversion])
19+
version='1.5.3'
20+
numversion=tuple(map(int,version.split('.')))
21+
22+
extras_require= {}
23+
install_requires= ['lazy_object_proxy','six','wrapt']
24+
25+
26+
defhas_environment_marker_range_operators_support():
27+
"""Code extracted from 'pytest/setup.py'
28+
https://github.com/pytest-dev/pytest/blob/7538680c/setup.py#L31
29+
30+
The first known release to support environment marker with range operators
31+
it is 17.1, see: https://setuptools.readthedocs.io/en/latest/history.html#id113
32+
"""
33+
returnparse_version(setuptools_version)>=parse_version('17.1')
34+
35+
36+
ifhas_environment_marker_range_operators_support():
37+
extras_require[':python_version<"3.4"']= ['enum34>=1.1.3','singledispatch']
38+
extras_require[':python_version<"3.3"']= ['backports.functools_lru_cache']
39+
else:
40+
ifpy_version< (3,4):
41+
install_requires.extend(['enum34','singledispatch'])
42+
ifpy_version< (3,3):
43+
install_requires.append('backports.functools_lru_cache')
2544

26-
install_requires= ['six','lazy_object_proxy','wrapt']
2745

46+
# pylint: disable=redefined-builtin; why license is a builtin anyway?
2847
license='LGPL'
2948

3049
author='Python Code Quality Authority'

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp