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

branch
eric7
changeset 8312
800c432b34c8
parent 8208
37836fa8e4ea
child 8682
04e80d1aaebf
equal deleted inserted replaced
8311:4e8b98454baa 8312:800c432b34c8
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2010 - 2021 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.3.1'
35
36 """
37 pyflakes repository date: 2021-03-24.
38 """
39
40 """ Changes
41 2.3.1 (2021-03-24)
42
43 - Fix regression in 2.3.0: type annotations no longer redefine imports
44
45 2.3.0 (2021-03-14)
46
47 - Recognize tuple concatenation in ``__all__`` export definitions
48 - Better support use of annotation-only assignments when using
49 ``from __future__ import annotations``
50 - Recognize special-case typing for ``Annotated``
51 - Fix undefined name ``__qualname__`` in class scope
52 - Recognize special-cased typing for ``TypeVar``
53 - Errors for undefined exports in ``__all__`` are shown in a deterministic
54 order
55 - Fix false positives in certain typing constructs (``TypeVar``,
56 ``NamedTuple``, ``TypedDict``, ``cast``)
57
58 2.2.0 (2020-04-08)
59
60 - Include column information in error messages
61 - Fix ``@overload`` detection with other decorators and in non-global scopes
62 - Fix return-type annotation being a class member
63 - Fix assignment to ``_`` in doctests with existing ``_`` name
64 - Namespace attributes which are attached to ast nodes with ``_pyflakes_`` to
65 avoid conflicts with other libraries (notably bandit)
66 - Add check for f-strings without placeholders
67 - Add check for unused/extra/invalid ``'string literal'.format(...)``
68 - Add check for unused/extra/invalid ``'string literal % ...``
69 - Improve python shebang detection
70 - Allow type ignore to be followed by a code ``# type: ignore[attr-defined]``
71 - Add support for assignment expressions (PEP 572)
72 - Support ``@overload`` detection from ``typing_extensions`` as well
73 - Fix ``@overload`` detection for async functions
74 - Allow ``continue`` inside ``finally`` in python 3.8+
75 - Fix handling of annotations in positional-only arguments
76 - Make pyflakes more resistant to future syntax additions
77 - Fix false positives in partially quoted type annotations
78 - Warn about ``is`` comparison to tuples
79 - Fix ``Checker`` usage with async function subtrees
80 - Add check for ``if`` of non-empty tuple
81 - Switch from ``optparse`` to ``argparse``
82 - Fix false positives in partially quoted type annotations in unusual contexts
83 - Be more cautious when identifying ``Literal`` type expressions
84
85 2.1.1 (2019-02-28)
86 - Fix reported line number for type comment errors
87 - Fix typing.overload check to only check imported names
88
89 2.1.0 (2019-01-23)
90
91 - Allow intentional assignment to variables named ``_``
92 - Recognize ``__module__`` as a valid name in class scope
93 - ``pyflakes.checker.Checker`` supports checking of partial ``ast`` trees
94 - Detect assign-before-use for local variables which shadow builtin names
95 - Detect invalid ``print`` syntax using ``>>`` operator
96 - Treat ``async for`` the same as a ``for`` loop for introducing variables
97 - Add detection for list concatenation in ``__all__``
98 - Exempt ``@typing.overload`` from duplicate function declaration
99 - Importing a submodule of an ``as``-aliased ``import``-import is marked as
100 used
101 - Report undefined names from ``__all__`` as possibly coming from a ``*``
102 import
103 - Add support for changes in Python 3.8-dev
104 - Add support for PEP 563 (``from __future__ import annotations``)
105 - Include Python version and platform information in ``pyflakes --version``
106 - Recognize ``__annotations__`` as a valid magic global in Python 3.6+
107 - Mark names used in PEP 484 ``# type: ...`` comments as used
108 - Add check for use of ``is`` operator with ``str``, ``bytes``, and ``int``
109 literals
110
111 2.0.0 (2018-05-20)
112 - Drop support for EOL Python <2.7 and 3.2-3.3
113 - Check for unused exception binding in `except:` block
114 - Handle string literal type annotations
115 - Ignore redefinitions of `_`, unless originally defined by import
116 - Support `__class__` without `self` in Python 3
117 - Issue an error for `raise NotImplemented(...)`
118
119 1.6.0 (2017-08-03)
120 - Process function scope variable annotations for used names
121 - Find Python files without extensions by their shebang
122
123 1.5.0 (2017-01-09)
124 - Enable support for PEP 526 annotated assignments
125
126 1.4.0 (2016-12-30):
127 - Change formatting of ImportStarMessage to be consistent with other errors
128 - Support PEP 498 "f-strings"
129
130 1.3.0 (2016-09-01):
131 - Fix PyPy2 Windows IntegrationTests
132 - Check for duplicate dictionary keys
133 - Fix TestMain tests on Windows
134 - Fix "continue" and "break" checks ignoring py3.5's "async for" loop
135
136 1.2.3 (2016-05-12):
137 - Fix TypeError when processing relative imports
138
139 1.2.2 (2016-05-06):
140 - Avoid traceback when exception is del-ed in except
141
142 1.2.1 (2015-05-05):
143 - Fix false RedefinedWhileUnesed for submodule imports
144
145 1.2.0 (2016-05-03):
146 - Warn against reusing exception names after the except block on Python 3
147 - Improve the error messages for imports
148
149 1.1.0 (2016-03-01):
150 - Allow main() to accept arguments.
151 - Support @ matrix-multiplication operator
152 - Validate __future__ imports
153 - Fix doctest scope testing
154 - Warn for tuple assertions which are always true
155 - Warn for "import *" not at module level on Python 3
156 - Catch many more kinds of SyntaxErrors
157 - Check PEP 498 f-strings
158 - (and a few more sundry bugfixes)
159
160 1.0.0 (2015-09-20):
161 - Python 3.5 support. async/await statements in particular.
162 - Fix test_api.py on Windows.
163 - Eliminate a false UnusedImport warning when the name has been
164 declared "global"
165
166 0.9.2 (2015-06-17):
167 - Fix a traceback when a global is defined in one scope, and used in another.
168
169 0.9.1 (2015-06-09):
170 - Update NEWS.txt to include 0.9.0, which had been forgotten.
171
172 0.9.0 (2015-05-31):
173 - Exit gracefully, not with a traceback, on SIGINT and SIGPIPE.
174 - Fix incorrect report of undefined name when using lambda expressions in
175 generator expressions.
176 - Don't crash on DOS line endings on Windows and Python 2.6.
177 - Don't report an undefined name if the 'del' which caused a name to become
178 undefined is only conditionally executed.
179 - Properly handle differences in list comprehension scope in Python 3.
180 - Improve handling of edge cases around 'global' defined variables.
181 - Report an error for 'return' outside a function.
182
183 0.8.1 (2014-03-30):
184 - Detect the declared encoding in Python 3.
185 - Do not report redefinition of import in a local scope, if the
186 global name is used elsewhere in the module.
187 - Catch undefined variable in loop generator when it is also used as
188 loop variable.
189 - Report undefined name for `(a, b) = (1, 2)` but not for the general
190 unpacking `(a, b) = func()`.
191 - Correctly detect when an imported module is used in default arguments
192 of a method, when the method and the module use the same name.
193 - Distribute a universal wheel file.
194
195 0.8.0 (2014-03-22):
196 - Adapt for the AST in Python 3.4.
197 - Fix caret position on SyntaxError.
198 - Fix crash on Python 2.x with some doctest SyntaxError.
199 - Add tox.ini.
200 - The `PYFLAKES_NODOCTEST` environment variable has been replaced with the
201 `PYFLAKES_DOCTEST` environment variable (with the opposite meaning).
202 Doctest checking is now disabled by default; set the environment variable
203 to enable it.
204 - Correctly parse incremental `__all__ += [...]`.
205 - Catch return with arguments inside a generator (Python <= 3.2).
206 - Do not complain about `_` in doctests.
207 - Drop deprecated methods `pushFunctionScope` and `pushClassScope`.
208
209 0.7.3 (2013-07-02):
210 - Do not report undefined name for generator expression and dict or
211 set comprehension at class level.
212 - Deprecate `Checker.pushFunctionScope` and `Checker.pushClassScope`:
213 use `Checker.pushScope` instead.
214 - Remove dependency on Unittest2 for the tests.
215
216 0.7.2 (2013-04-24):
217 - Fix computation of `DoctestSyntaxError.lineno` and `col`.
218 - Add boolean attribute `Checker.withDoctest` to ignore doctests.
219 - If environment variable `PYFLAKES_NODOCTEST` is set, skip doctests.
220 - Environment variable `PYFLAKES_BUILTINS` accepts a comma-separated
221 list of additional built-in names.
222
223 0.7.1 (2013-04-23):
224 - File `bin/pyflakes` was missing in tarball generated with distribute.
225 - Fix reporting errors in non-ASCII filenames (Python 2.x).
226
227 0.7.0 (2013-04-17):
228 - Add --version and --help options.
229 - Support `python -m pyflakes` (Python 2.7 and Python 3.x).
230 - Add attribute `Message.col` to report column offset.
231 - Do not report redefinition of variable for a variable used in a list
232 comprehension in a conditional.
233 - Do not report redefinition of variable for generator expressions and
234 set or dict comprehensions.
235 - Do not report undefined name when the code is protected with a
236 `NameError` exception handler.
237 - Do not report redefinition of variable when unassigning a module imported
238 for its side-effect.
239 - Support special locals like `__tracebackhide__` for py.test.
240 - Support checking doctests.
241 - Fix issue with Turkish locale where `'i'.upper() == 'i'` in Python 2.
242
243 0.6.1 (2013-01-29):
244 - Fix detection of variables in augmented assignments.
245
246 0.6.0 (2013-01-29):
247 - Support Python 3 up to 3.3, based on the pyflakes3k project.
248 - Preserve compatibility with Python 2.5 and all recent versions of Python.
249 - Support custom reporters in addition to the default Reporter.
250 - Allow function redefinition for modern property construction via
251 property.setter/deleter.
252 - Fix spurious redefinition warnings in conditionals.
253 - Do not report undefined name in __all__ if import * is used.
254 - Add WindowsError as a known built-in name on all platforms.
255 - Support specifying additional built-ins in the `Checker` constructor.
256 - Don't issue Unused Variable warning when using locals() in current scope.
257 - Handle problems with the encoding of source files.
258 - Remove dependency on Twisted for the tests.
259 - Support `python setup.py test` and `python setup.py develop`.
260 - Create script using setuptools `entry_points` to support all platforms,
261 including Windows.
262
263 0.5.0 (2011-09-02):
264 - Convert pyflakes to use newer _ast infrastructure rather than compiler.
265 - Support for new syntax in 2.7 (including set literals, set comprehensions,
266 and dictionary comprehensions).
267 - Make sure class names don't get bound until after class definition.
268
269 0.4.0 (2009-11-25):
270 - Fix reporting for certain SyntaxErrors which lack line number
271 information.
272 - Check for syntax errors more rigorously.
273 - Support checking names used with the class decorator syntax in versions
274 of Python which have it.
275 - Detect local variables which are bound but never used.
276 - Handle permission errors when trying to read source files.
277 - Handle problems with the encoding of source files.
278 - Support importing dotted names so as not to incorrectly report them as
279 redefined unused names.
280 - Support all forms of the with statement.
281 - Consider static `__all__` definitions and avoid reporting unused names
282 if the names are listed there.
283 - Fix incorrect checking of class names with respect to the names of their
284 bases in the class statement.
285 - Support the `__path__` global in `__init__.py`.
286
287 0.3.0 (2009-01-30):
288 - Display more informative SyntaxError messages.
289 - Don't hang flymake with unmatched triple quotes (only report a single
290 line of source for a multiline syntax error).
291 - Recognize __builtins__ as a defined name.
292 - Improve pyflakes support for python versions 2.3-2.5
293 - Support for if-else expressions and with statements.
294 - Warn instead of error on non-existant file paths.
295 - Check for __future__ imports after other statements.
296 - Add reporting for some types of import shadowing.
297 - Improve reporting of unbound locals
298 """

eric ide

mercurial