diff options
author | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2009-11-23 15:15:26 +0100 |
---|---|---|
committer | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2009-11-23 15:15:26 +0100 |
commit | 8746b95b65267dfa758174cd2de61719f7fb4697 (patch) | |
tree | 490da9d4b55bc43841ad96b78abb7eb5f40e980a /checkers | |
parent | 414e7a121c56301ea38978014ecf7a398e91530f (diff) | |
download | pylint-git-8746b95b65267dfa758174cd2de61719f7fb4697.tar.gz |
include Dotan Barak spell fixes patch
Diffstat (limited to 'checkers')
-rw-r--r-- | checkers/__init__.py | 2 | ||||
-rwxr-xr-x | checkers/base.py | 8 | ||||
-rw-r--r-- | checkers/classes.py | 22 | ||||
-rw-r--r-- | checkers/exceptions.py | 2 | ||||
-rw-r--r-- | checkers/format.py | 8 | ||||
-rw-r--r-- | checkers/imports.py | 2 | ||||
-rw-r--r-- | checkers/similar.py | 2 | ||||
-rw-r--r-- | checkers/typecheck.py | 22 | ||||
-rw-r--r-- | checkers/utils.py | 8 | ||||
-rw-r--r-- | checkers/variables.py | 18 |
10 files changed, 47 insertions, 47 deletions
diff --git a/checkers/__init__.py b/checkers/__init__.py index 4f2146850..657bebe24 100644 --- a/checkers/__init__.py +++ b/checkers/__init__.py @@ -125,7 +125,7 @@ class BaseRawChecker(BaseChecker): self.process_tokens(tokenize.generate_tokens(stream.readline)) def process_tokens(self, tokens): - """should be overiden by subclasses""" + """should be overridden by subclasses""" raise NotImplementedError() diff --git a/checkers/base.py b/checkers/base.py index 3b66931a1..b07853705 100755 --- a/checkers/base.py +++ b/checkers/base.py @@ -28,7 +28,7 @@ from pylint.checkers import BaseChecker import re -# regex for class/function/variable/constant nane +# regex for class/function/variable/constant name CLASS_NAME_RGX = re.compile('[A-Z_][a-zA-Z0-9]+$') MOD_NAME_RGX = re.compile('(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$') CONST_NAME_RGX = re.compile('(([A-Z_][A-Z0-9_]*)|(__.*__))$') @@ -180,7 +180,7 @@ class BasicChecker(BaseChecker): """checks for : * doc strings * modules / classes / functions / methods / arguments / variables name - * number of arguments, local variables, branchs, returns and statements in + * number of arguments, local variables, branches, returns and statements in functions, methods * required module attributes * dangerous default values as arguments @@ -505,7 +505,7 @@ functions, methods self._check_unreachable(node) def visit_exec(self, node): - """just pring a warning on exec statements""" + """just print a warning on exec statements""" self.add_message('W0122', node=node) def visit_callfunc(self, node): @@ -514,7 +514,7 @@ functions, methods """ if isinstance(node.func, astng.Name): name = node.func.name - # ignore the name if it's not a builtin (ie not defined in the + # ignore the name if it's not a builtin (i.e. not defined in the # locals nor globals scope) if not (node.frame().has_key(name) or node.root().has_key(name)): diff --git a/checkers/classes.py b/checkers/classes.py index b8bec9518..eb306d557 100644 --- a/checkers/classes.py +++ b/checkers/classes.py @@ -27,11 +27,11 @@ from pylint.checkers.utils import PYMETHODS, overrides_a_method MSGS = { 'F0202': ('Unable to check methods signature (%s / %s)', 'Used when PyLint has been unable to check methods signature \ - compatibility for an unexpected raison. Please report this kind \ + compatibility for an unexpected reason. Please report this kind \ if you don\'t make sense of it.'), 'E0202': ('An attribute inherited from %s hide this method', - 'Used when a class defines a method which is hiden by an \ + 'Used when a class defines a method which is hidden by an \ instance attribute from an ancestor class.'), 'E0203': ('Access to member %r before its definition line %s', 'Used when an instance member is accessed before it\'s actually\ @@ -51,7 +51,7 @@ MSGS = { 'E0213': ('Method should have "self" as first argument', 'Used when a method has an attribute different the "self" as\ first argument. This is considered as an error since this is\ - a soooo common convention that you should\'nt break it!'), + a so common convention that you shouldn\'t break it!'), 'C0202': ('Class method should have "cls" as first argument', # E0212 'Used when a class method has an attribute different than "cls"\ as first argument, to easily differentiate them from regular \ @@ -81,7 +81,7 @@ MSGS = { 'Used when a method signature is different than in the \ implemented interface or in an overridden method.'), 'W0223': ('Method %r is abstract in class %r but is not overridden', - 'Used when an abstract method (ie raise NotImplementedError) is \ + 'Used when an abstract method (i.e. raise NotImplementedError) is \ not overridden in concrete class.' ), 'F0220': ('failed to resolve interfaces implemented by %s (%s)', # W0224 @@ -106,7 +106,7 @@ class ClassChecker(BaseChecker): """checks for : * methods without self as first argument * overridden methods signature - * access only to existant members via self + * access only to existent members via self * attributes not defined in the __init__ method * supported interfaces implementation * unreachable code @@ -170,7 +170,7 @@ instance attributes.'} def leave_class(self, cnode): """close a class node: check that instance attributes are defined in __init__ and check - access to existant members + access to existent members """ # checks attributes are defined in an allowed method such as __init__ defining_methods = self.config.defining_attr_methods @@ -194,7 +194,7 @@ instance attributes.'} cnode.local_attr(attr) except astng.NotFoundError: self.add_message('W0201', args=attr, node=node) - # check access to existant members on non metaclass classes + # check access to existent members on non metaclass classes accessed = self._accessed.pop() if cnode.type != 'metaclass': self._check_accessed_members(cnode, accessed) @@ -211,14 +211,14 @@ instance attributes.'} if node.name == '__init__': self._check_init(node) return - # check signature if the method overrload an herited method + # check signature if the method overloads inherited method for overridden in klass.local_attr_ancestors(node.name): # get astng for the searched method try: meth_node = overridden[node.name] except KeyError: # we have found the method but it's not in the local - # dictionnary. + # dictionary. # This may happen with astng build from living objects continue if not isinstance(meth_node, astng.Function): @@ -322,7 +322,7 @@ instance attributes.'} if len(defstmts) == 1: defstmt = defstmts[0] # check that if the node is accessed in the same method as - # it's defined, it's accessed after the initial assigment + # it's defined, it's accessed after the initial assignment frame = defstmt.frame() lno = defstmt.fromlineno for _node in nodes: @@ -398,7 +398,7 @@ instance attributes.'} for imethod in iface.methods(): name = imethod.name if name.startswith('_') or name in ignore_iface_methods: - # don't check method begining with an underscore, + # don't check method beginning with an underscore, # usually belonging to the interface implementation continue # get class method astng diff --git a/checkers/exceptions.py b/checkers/exceptions.py index 9e64d0f43..af9d2d07a 100644 --- a/checkers/exceptions.py +++ b/checkers/exceptions.py @@ -74,7 +74,7 @@ class ExceptionsChecker(BaseChecker): options = () def visit_raise(self, node): - """visit raise possibly infering value""" + """visit raise possibly inferring value""" # ignore empty raise if node.type is None: return diff --git a/checkers/format.py b/checkers/format.py index 00b10f895..fd6bc99e3 100644 --- a/checkers/format.py +++ b/checkers/format.py @@ -36,7 +36,7 @@ MSGS = { 'C0301': ('Line too long (%s/%s)', 'Used when a line is longer than a given number of characters.'), 'C0302': ('Too many lines in module (%s)', # was W0302 - 'Used when a module has too much lines, reducing its readibility.' + 'Used when a module has too much lines, reducing its readability.' ), 'W0311': ('Bad indentation. Found %s %s, expected %s', @@ -45,11 +45,11 @@ MSGS = { 'W0312': ('Found indentation with %ss instead of %ss', 'Used when there are some mixed tabs and spaces in a module.'), 'W0301': ('Unnecessary semicolon', # was W0106 - 'Used when a statement is endend by a semi-colon (";"), which \ + 'Used when a statement is ended by a semi-colon (";"), which \ isn\'t necessary (that\'s python, not C ;).'), 'F0321': ('Format detection error in %r', - 'Used when an unexpected error occured in bad format detection.' + 'Used when an unexpected error occurred in bad format detection.' 'Please report the error if it occurs.'), 'C0321': ('More than one statement on a single line', 'Used when more than on statement are found on the same line.'), @@ -123,7 +123,7 @@ def get_string_coords(line): return result def in_coords(match, string_coords): - """return true if the match in in the string coord""" + """return true if the match is in the string coord""" mstart = match.start() for start, end in string_coords: if mstart >= start and mstart < end: diff --git a/checkers/imports.py b/checkers/imports.py index 1eef1f32b..37df06c95 100644 --- a/checkers/imports.py +++ b/checkers/imports.py @@ -59,7 +59,7 @@ def filter_dependencies_info(dep_info, package_dir, mode='external'): def make_tree_defs(mod_files_list): """get a list of 2-uple (module, list_of_files_which_import_this_module), - it will return a dictionnary to represent this as a tree + it will return a dictionary to represent this as a tree """ tree_defs = {} for mod, files in mod_files_list: diff --git a/checkers/similar.py b/checkers/similar.py index 0db002abf..60a6ec031 100644 --- a/checkers/similar.py +++ b/checkers/similar.py @@ -14,7 +14,7 @@ # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -"""a similarties / code duplication command line tool and pylint checker +"""a similarities / code duplication command line tool and pylint checker """ from __future__ import generators diff --git a/checkers/typecheck.py b/checkers/typecheck.py index df051edd7..2872a173d 100644 --- a/checkers/typecheck.py +++ b/checkers/typecheck.py @@ -29,20 +29,20 @@ from pylint.checkers.utils import safe_infer, is_super, display_type MSGS = { 'E1101': ('%s %r has no %r member', - 'Used when a variable is accessed for an unexistant member.'), + 'Used when a variable is accessed for an unexistent member.'), 'E1102': ('%s is not callable', - 'Used when an object being called has been infered to a non \ + 'Used when an object being called has been inferred to a non \ callable object'), 'E1103': ('%s %r has no %r member (but some types could not be inferred)', - 'Used when a variable is accessed for an unexistant member, but \ + 'Used when a variable is accessed for an unexistent member, but \ astng was not able to interpret all possible types of this \ variable.'), 'E1111': ('Assigning to function call which doesn\'t return', - 'Used when an assigment is done on a function call but the \ - infered function doesn\'t return anything.'), + 'Used when an assignment is done on a function call but the \ + inferred function doesn\'t return anything.'), 'W1111': ('Assigning to function call which only returns None', - 'Used when an assigment is done on a function call but the \ - infered function returns nothing but None.'), + 'Used when an assignment is done on a function call but the \ + inferred function returns nothing but None.'), } class TypeChecker(BaseChecker): @@ -59,7 +59,7 @@ class TypeChecker(BaseChecker): # configuration options options = (('ignore-mixin-members', {'default' : True, 'type' : 'yn', 'metavar': '<y_or_n>', - 'help' : 'Tells wether missing members accessed in mixin \ + 'help' : 'Tells whether missing members accessed in mixin \ class should be ignored. A mixin class is detected if its name ends with \ "mixin" (case insensitive).'} ), @@ -69,7 +69,7 @@ class should be ignored. A mixin class is detected if its name ends with \ 'type' : 'csv', 'metavar' : '<members names>', 'help' : 'List of classes names for which member attributes \ -should not be checked (useful for classes with attributes dynamicaly set).'} +should not be checked (useful for classes with attributes dynamically set).'} ), ('zope', @@ -104,7 +104,7 @@ accessed.'} """check that the accessed attribute exists to avoid to much false positives for now, we'll consider the code as - correct if a single of the infered nodes has the accessed attribute. + correct if a single of the inferred nodes has the accessed attribute. function/method, super call and metaclasses are ignored """ @@ -182,7 +182,7 @@ accessed.'} if not isinstance(node.value, astng.CallFunc): return function_node = safe_infer(node.value.func) - # skip class, generator and uncomplete function definition + # skip class, generator and incomplete function definition if not (isinstance(function_node, astng.Function) and function_node.root().fully_defined()): return diff --git a/checkers/utils.py b/checkers/utils.py index f3e298584..362c2f603 100644 --- a/checkers/utils.py +++ b/checkers/utils.py @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -"""some functions that may be usefull for various checkers +"""some functions that may be useful for various checkers """ from logilab import astng @@ -29,9 +29,9 @@ except AttributeError: FOR_NODE_TYPES = (astng.For, astng.Comprehension) def safe_infer(node): - """return the infered value for the given node. + """return the inferred value for the given node. Return None if inference failed or if there is some ambiguity (more than - one node has been infered) + one node has been inferred) """ try: inferit = node.infer() @@ -40,7 +40,7 @@ def safe_infer(node): return try: inferit.next() - return # None if there is ambiguity on the infered node + return # None if there is ambiguity on the inferred node except StopIteration: return value diff --git a/checkers/variables.py b/checkers/variables.py index b6acb2386..454fc9c63 100644 --- a/checkers/variables.py +++ b/checkers/variables.py @@ -30,7 +30,7 @@ from pylint.checkers.utils import PYMETHODS, is_ancestor_name, is_builtin, \ def overridden_method(klass, name): - """get overriden method if any""" + """get overridden method if any""" try: parent = klass.local_attr_ancestors(name).next() except (StopIteration, KeyError): @@ -59,9 +59,9 @@ MSGS = { 'W0601': ('Global variable %r undefined at the module level', 'Used when a variable is defined through the "global" statement \ but the variable is not defined in the module scope.'), - 'W0602': ('Using global for %r but no assigment is done', + 'W0602': ('Using global for %r but no assignment is done', 'Used when a variable is defined through the "global" statement \ - but no assigment to this variable is done.'), + but no assignment to this variable is done.'), 'W0603': ('Using the global statement', # W0121 'Used when you use the "global" statement to update a global \ variable. PyLint just try to discourage this \ @@ -96,7 +96,7 @@ class VariablesChecker(BaseChecker): * unused variables / imports * undefined variables * redefinition of variable from builtins or from an outer scope - * use of variable before assigment + * use of variable before assignment """ __implements__ = IASTNGChecker @@ -107,7 +107,7 @@ class VariablesChecker(BaseChecker): options = ( ("init-import", {'default': 0, 'type' : 'yn', 'metavar' : '<y_or_n>', - 'help' : 'Tells wether we should check for unused import in \ + 'help' : 'Tells whether we should check for unused import in \ __init__ files.'}), ("dummy-variables-rgx", {'default': ('_|dummy'), @@ -265,17 +265,17 @@ builtins. Remember that you should avoid to define new builtins when possible.' assign_nodes = [] for anode in assign_nodes: if anode.frame() is frame: - # same scope level assigment + # same scope level assignment break else: - # global but no assigment + # global but no assignment self.add_message('W0602', args=name, node=node) default_message = False if not assign_nodes: continue for anode in assign_nodes: if anode.frame() is module: - # module level assigment + # module level assignment break else: # global undefined at the module scope @@ -355,7 +355,7 @@ builtins. Remember that you should avoid to define new builtins when possible.' except KeyError: continue else: - # checks for use before assigment + # checks for use before assignment defnode = assign_parent(to_consume[name][0]) if defnode is not None: defstmt = defnode.statement() |