eric6/Plugins/CheckerPlugins/SyntaxChecker/pyflakes/__init__.py

changeset 6942
2602857055c5
parent 6742
7cb30f7f94f6
child 7064
1010f737def2
equal deleted inserted replaced
6941:f99d60d6b59b 6942:2602857055c5
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2010 - 2019 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6 """
7 Package containg pyflakes adapted for Qt.
8 """
9
10 """ License
11 Copyright 2005-2011 Divmod, Inc.
12 Copyright 2013-2014 Florent Xicluna
13
14 Permission is hereby granted, free of charge, to any person obtaining
15 a copy of this software and associated documentation files (the
16 "Software"), to deal in the Software without restriction, including
17 without limitation the rights to use, copy, modify, merge, publish,
18 distribute, sublicense, and/or sell copies of the Software, and to
19 permit persons to whom the Software is furnished to do so, subject to
20 the following conditions:
21
22 The above copyright notice and this permission notice shall be
23 included in all copies or substantial portions of the Software.
24
25 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
29 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
30 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
31 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 """
33
34 __version__ = '2.1.0+'
35
36 """ Changes
37 2.1.0 (2019-01-23)
38
39 - Allow intentional assignment to variables named ``_``
40 - Recognize ``__module__`` as a valid name in class scope
41 - ``pyflakes.checker.Checker`` supports checking of partial ``ast`` trees
42 - Detect assign-before-use for local variables which shadow builtin names
43 - Detect invalid ``print`` syntax using ``>>`` operator
44 - Treat ``async for`` the same as a ``for`` loop for introducing variables
45 - Add detection for list concatenation in ``__all__``
46 - Exempt ``@typing.overload`` from duplicate function declaration
47 - Importing a submodule of an ``as``-aliased ``import``-import is marked as
48 used
49 - Report undefined names from ``__all__`` as possibly coming from a ``*``
50 import
51 - Add support for changes in Python 3.8-dev
52 - Add support for PEP 563 (``from __future__ import annotations``)
53 - Include Python version and platform information in ``pyflakes --version``
54 - Recognize ``__annotations__`` as a valid magic global in Python 3.6+
55 - Mark names used in PEP 484 ``# type: ...`` comments as used
56 - Add check for use of ``is`` operator with ``str``, ``bytes``, and ``int``
57 literals
58
59 2.0.0 (2018-05-20)
60 - Drop support for EOL Python <2.7 and 3.2-3.3
61 - Check for unused exception binding in `except:` block
62 - Handle string literal type annotations
63 - Ignore redefinitions of `_`, unless originally defined by import
64 - Support `__class__` without `self` in Python 3
65 - Issue an error for `raise NotImplemented(...)`
66
67 1.6.0 (2017-08-03)
68 - Process function scope variable annotations for used names
69 - Find Python files without extensions by their shebang
70
71 1.5.0 (2017-01-09)
72 - Enable support for PEP 526 annotated assignments
73
74 1.4.0 (2016-12-30):
75 - Change formatting of ImportStarMessage to be consistent with other errors
76 - Support PEP 498 "f-strings"
77
78 1.3.0 (2016-09-01):
79 - Fix PyPy2 Windows IntegrationTests
80 - Check for duplicate dictionary keys
81 - Fix TestMain tests on Windows
82 - Fix "continue" and "break" checks ignoring py3.5's "async for" loop
83
84 1.2.3 (2016-05-12):
85 - Fix TypeError when processing relative imports
86
87 1.2.2 (2016-05-06):
88 - Avoid traceback when exception is del-ed in except
89
90 1.2.1 (2015-05-05):
91 - Fix false RedefinedWhileUnesed for submodule imports
92
93 1.2.0 (2016-05-03):
94 - Warn against reusing exception names after the except block on Python 3
95 - Improve the error messages for imports
96
97 1.1.0 (2016-03-01):
98 - Allow main() to accept arguments.
99 - Support @ matrix-multiplication operator
100 - Validate __future__ imports
101 - Fix doctest scope testing
102 - Warn for tuple assertions which are always true
103 - Warn for "import *" not at module level on Python 3
104 - Catch many more kinds of SyntaxErrors
105 - Check PEP 498 f-strings
106 - (and a few more sundry bugfixes)
107
108 1.0.0 (2015-09-20):
109 - Python 3.5 support. async/await statements in particular.
110 - Fix test_api.py on Windows.
111 - Eliminate a false UnusedImport warning when the name has been
112 declared "global"
113
114 0.9.2 (2015-06-17):
115 - Fix a traceback when a global is defined in one scope, and used in another.
116
117 0.9.1 (2015-06-09):
118 - Update NEWS.txt to include 0.9.0, which had been forgotten.
119
120 0.9.0 (2015-05-31):
121 - Exit gracefully, not with a traceback, on SIGINT and SIGPIPE.
122 - Fix incorrect report of undefined name when using lambda expressions in
123 generator expressions.
124 - Don't crash on DOS line endings on Windows and Python 2.6.
125 - Don't report an undefined name if the 'del' which caused a name to become
126 undefined is only conditionally executed.
127 - Properly handle differences in list comprehension scope in Python 3.
128 - Improve handling of edge cases around 'global' defined variables.
129 - Report an error for 'return' outside a function.
130
131 0.8.1 (2014-03-30):
132 - Detect the declared encoding in Python 3.
133 - Do not report redefinition of import in a local scope, if the
134 global name is used elsewhere in the module.
135 - Catch undefined variable in loop generator when it is also used as
136 loop variable.
137 - Report undefined name for `(a, b) = (1, 2)` but not for the general
138 unpacking `(a, b) = func()`.
139 - Correctly detect when an imported module is used in default arguments
140 of a method, when the method and the module use the same name.
141 - Distribute a universal wheel file.
142
143 0.8.0 (2014-03-22):
144 - Adapt for the AST in Python 3.4.
145 - Fix caret position on SyntaxError.
146 - Fix crash on Python 2.x with some doctest SyntaxError.
147 - Add tox.ini.
148 - The `PYFLAKES_NODOCTEST` environment variable has been replaced with the
149 `PYFLAKES_DOCTEST` environment variable (with the opposite meaning).
150 Doctest checking is now disabled by default; set the environment variable
151 to enable it.
152 - Correctly parse incremental `__all__ += [...]`.
153 - Catch return with arguments inside a generator (Python <= 3.2).
154 - Do not complain about `_` in doctests.
155 - Drop deprecated methods `pushFunctionScope` and `pushClassScope`.
156
157 0.7.3 (2013-07-02):
158 - Do not report undefined name for generator expression and dict or
159 set comprehension at class level.
160 - Deprecate `Checker.pushFunctionScope` and `Checker.pushClassScope`:
161 use `Checker.pushScope` instead.
162 - Remove dependency on Unittest2 for the tests.
163
164 0.7.2 (2013-04-24):
165 - Fix computation of `DoctestSyntaxError.lineno` and `col`.
166 - Add boolean attribute `Checker.withDoctest` to ignore doctests.
167 - If environment variable `PYFLAKES_NODOCTEST` is set, skip doctests.
168 - Environment variable `PYFLAKES_BUILTINS` accepts a comma-separated
169 list of additional built-in names.
170
171 0.7.1 (2013-04-23):
172 - File `bin/pyflakes` was missing in tarball generated with distribute.
173 - Fix reporting errors in non-ASCII filenames (Python 2.x).
174
175 0.7.0 (2013-04-17):
176 - Add --version and --help options.
177 - Support `python -m pyflakes` (Python 2.7 and Python 3.x).
178 - Add attribute `Message.col` to report column offset.
179 - Do not report redefinition of variable for a variable used in a list
180 comprehension in a conditional.
181 - Do not report redefinition of variable for generator expressions and
182 set or dict comprehensions.
183 - Do not report undefined name when the code is protected with a
184 `NameError` exception handler.
185 - Do not report redefinition of variable when unassigning a module imported
186 for its side-effect.
187 - Support special locals like `__tracebackhide__` for py.test.
188 - Support checking doctests.
189 - Fix issue with Turkish locale where `'i'.upper() == 'i'` in Python 2.
190
191 0.6.1 (2013-01-29):
192 - Fix detection of variables in augmented assignments.
193
194 0.6.0 (2013-01-29):
195 - Support Python 3 up to 3.3, based on the pyflakes3k project.
196 - Preserve compatibility with Python 2.5 and all recent versions of Python.
197 - Support custom reporters in addition to the default Reporter.
198 - Allow function redefinition for modern property construction via
199 property.setter/deleter.
200 - Fix spurious redefinition warnings in conditionals.
201 - Do not report undefined name in __all__ if import * is used.
202 - Add WindowsError as a known built-in name on all platforms.
203 - Support specifying additional built-ins in the `Checker` constructor.
204 - Don't issue Unused Variable warning when using locals() in current scope.
205 - Handle problems with the encoding of source files.
206 - Remove dependency on Twisted for the tests.
207 - Support `python setup.py test` and `python setup.py develop`.
208 - Create script using setuptools `entry_points` to support all platforms,
209 including Windows.
210
211 0.5.0 (2011-09-02):
212 - Convert pyflakes to use newer _ast infrastructure rather than compiler.
213 - Support for new syntax in 2.7 (including set literals, set comprehensions,
214 and dictionary comprehensions).
215 - Make sure class names don't get bound until after class definition.
216
217 0.4.0 (2009-11-25):
218 - Fix reporting for certain SyntaxErrors which lack line number
219 information.
220 - Check for syntax errors more rigorously.
221 - Support checking names used with the class decorator syntax in versions
222 of Python which have it.
223 - Detect local variables which are bound but never used.
224 - Handle permission errors when trying to read source files.
225 - Handle problems with the encoding of source files.
226 - Support importing dotted names so as not to incorrectly report them as
227 redefined unused names.
228 - Support all forms of the with statement.
229 - Consider static `__all__` definitions and avoid reporting unused names
230 if the names are listed there.
231 - Fix incorrect checking of class names with respect to the names of their
232 bases in the class statement.
233 - Support the `__path__` global in `__init__.py`.
234
235 0.3.0 (2009-01-30):
236 - Display more informative SyntaxError messages.
237 - Don't hang flymake with unmatched triple quotes (only report a single
238 line of source for a multiline syntax error).
239 - Recognize __builtins__ as a defined name.
240 - Improve pyflakes support for python versions 2.3-2.5
241 - Support for if-else expressions and with statements.
242 - Warn instead of error on non-existant file paths.
243 - Check for __future__ imports after other statements.
244 - Add reporting for some types of import shadowing.
245 - Improve reporting of unbound locals
246 """
247
248 #
249 # eflag: noqa = M702

eric ide

mercurial