Commit Graph

64 Commits

Author SHA1 Message Date
Avasam
e477c67852 Check *_pb2.pyi files again (#10909) 2023-10-23 01:22:55 +01:00
Avasam
35873ec3d8 Doc: Use proper name capitalization of tooling (Ruff, Black, Flake8) (#10913) 2023-10-18 23:46:53 +01:00
Alex Waygood
348f46452f flake8: Enable F822 (#10144) 2023-05-05 10:27:41 -07:00
Alex Waygood
99375e1b4c Bump flake8-pyi to 23.5.0; re-enable F821 (#10143) 2023-05-05 18:06:10 +02:00
Sebastian Rittau
027460f11a Remove unnecessary ellipsis expressions (#9976)
Ignore flake8 F821 warnings in stub files
2023-03-29 13:28:06 +02:00
Alex Waygood
f3fc792620 Bump flake8-pyi test dependency to 23.3.1 (#9906) 2023-03-20 19:19:01 +01:00
Alex Waygood
36515c48a9 flake8: ignore pyflakes codes in *_pb2.pyi files that are ignored in all other .pyi files (#9878)
Several flake8 error codes are currently ignored for all `.pyi` files _except_ those ending with `_pb2.pyi`. This caused a bit of confusion in #9873. This PR makes it so that all codes ignored generally across typeshed are also ignored in `*_pb2.pyi` files
2023-03-13 15:22:16 +00:00
Avasam
50acb57cda Ignore flake8 extensions stubbed by typeshed (#9715) 2023-02-19 12:42:03 +00:00
Alex Waygood
0ef9c3f8e8 Enable flake8-pyi's Y037 (#9686) 2023-02-06 19:01:02 -08:00
Alex Waygood
95dc689b28 Remove unneeded ignore in .flake8 (#9661)
B028 was renamed as B907, and we don't have any of the B9 rules enabled for this repo (they're all off by default)
2023-02-02 13:29:50 +00:00
Alex Waygood
2b9f200e7e Reenable flake8-pyi's Y011 and Y015 (#9551) 2023-01-16 22:52:40 +00:00
Alex Waygood
597e1a0078 Bump various test dependencies (#9549) 2023-01-16 11:04:45 -08:00
Mehdi Drissi
b76e61734f Allow default values in stubs. (#9490)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-01-11 14:31:45 +00:00
Avasam
c45999d905 Re-enable NQA102 (#9426)
re-enable NQA102
2023-01-02 23:49:02 +00:00
Alex Waygood
89f22278ba Bump flake8-pyi and pytype versions used in CI (#9268) 2022-11-24 14:55:26 +00:00
kasium
f9cd5ee859 Improve ast types; revert several "redundant numeric union" changes from #7906 (#9130)
* Adapt number types in ast

Since mypy  0.990 type promotions was limited.
This means that complex is not longer promoted to int/float, therefore
we should adapt the types to list all possible types

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2022-11-14 09:41:23 +00:00
Alex Waygood
d1d1afbe3a Bump flake8-bugbear; ignore flake8-bugbear in stub files (#9069) 2022-11-02 12:18:00 -07:00
Alex Waygood
b417d5796d Run flake8-noqa in CI (#8641) 2022-08-29 21:06:47 +01:00
Alex Waygood
8cf125d80d flake8 config: fix typo (#8626)
Accidentally introduced in #8612
2022-08-26 11:55:47 +01:00
Nipunn Koorapati
7beaebff40 Bump to mypy-protobuf 3.3.0 (#8612)
* Bump to mypy-protobuf 3.3.0

* Remove some ignores for formatting
2022-08-26 07:24:11 +01:00
Alex Waygood
556f6a10f6 Enable flake8-pyi's Y034 check in stdlib/typing.pyi (#8530) 2022-08-11 10:57:31 +02:00
Alex Waygood
78d96cd17e Drop support for Python 2 (#8272) 2022-07-12 09:08:56 +02:00
Alex Waygood
033516d39f flake8 config: Ignore more error codes in .py files (#8065)
black fixes these for us in `pre-commit.ci`.
2022-06-12 12:04:38 -07:00
Alex Waygood
5c6178a821 Import generics from standard modules in all third-party stubs (#7791) 2022-05-07 10:35:50 +02:00
Alex Waygood
7ce4607dee Upgrade flake8-pyi to 22.4.0, enable Y026 in .flake8 config (#7650) 2022-04-17 01:23:35 +01:00
Alex Waygood
536f783a82 Exclude Y037 in .flake8 config, for now (#7600)
Unblocks https://github.com/PyCQA/flake8-pyi/pull/202
2022-04-06 17:24:02 +01:00
Alex Waygood
ae6ff79c0e flake8 config: remove line that exists only for Python-2 checking (#7570) 2022-04-01 08:07:16 +02:00
Alex Waygood
85f060b26d Exclude the Python-2 stdlib from flake8 CI check (#7569)
We should hopefully be getting rid of this entire subdirectory soon anyway (#7367). This will make PRs to flake8-pyi a lot easier.
2022-03-31 23:35:45 +01:00
Alex Waygood
072f1c246e Add Y034 to list of ignored error codes for typing.pyi (#7336)
Unblocks https://github.com/PyCQA/flake8-pyi/pull/186
2022-02-20 17:13:18 -08:00
Alex Waygood
fe6233a8c3 Add Y027 to list of ignored .flake8 error codes (#6962)
Refs https://github.com/PyCQA/flake8-pyi/pull/104
2022-01-19 07:17:30 -08:00
Jelle Zijlstra
30580a3732 disable Y026 in typing.pyi too (#6959) 2022-01-18 20:14:55 -08:00
Jelle Zijlstra
65a8825e2f Disable Y026 from flake8-pyi (#6958)
Dependent on PyCQA/flake8-pyi#101.
2022-01-18 20:07:34 -08:00
Sebastian Rittau
f5059c0c41 Update flake8 config (#6684) 2021-12-26 14:45:15 +02:00
Akuli
b0ef85288d flake8: do not exclude @python2 dirs (#5457) 2021-05-15 12:05:26 +02:00
Nipunn Koorapati
9af49c0b69 Protobuf stubs update using mypy-protobuf (#4785)
* Add script to generate protoc stubs using mypy-protobuf generated stubs

* Use generate_proto_stubs to generate stubs for protobuf 3.14.0

* Skip _pb2.pyi from flake8,black,isort,pytype
2020-11-25 10:48:26 -08:00
Shantanu
48970d31de tests / scripts: blacken and isort (#4704)
I often run black and isort in typeshed root and then have to undo these
changes.

Co-authored-by: hauntsaninja <>
2020-10-25 11:21:03 +01:00
Sebastian Rittau
a913af9523 flake8: Enable F811 (#4158) 2020-06-02 14:08:54 -07:00
Sebastian Rittau
92f52a2615 flake8 updates and cleanups (#3940)
* flake8 updates and cleanups

* Update to flake8 3.7.9.
* Update to flake8-bugbear 20.1.4.
* Only ignore errors in stub files.
* Remove obsolete error counts.
* Sort error codes alphabetically.
* Don't ignore the following errors (unneeded):
    * E704 Multiple statements on one line (def)
    * W504 Line break occurred after a binary operator
    * B303 __metaclass__ used

* Remove obsolete comment

* Ignore F822 undefined name in __all__
2020-04-23 19:38:47 -07:00
Sebastian Rittau
d82d3396e7 Minor flake8 improvements (#3324)
* Update flake8-bugbear
* Remove unnecessary comment
* Add a comment about an upcoming fix
2019-10-08 17:42:36 +02:00
Sebastian Rittau
006a79220f Flake8 fixes (#2549)
* Fix over-indented continuation lines

* Fix under-indented continuation lines

* Fix whitespace around default operator problems

* Limit line lengths

* Fix inconsistent files
2018-10-24 07:20:53 -07:00
Sebastian Rittau
680d69bd81 Update to flake8 3.6.0 (#2547)
* Update to flake8 3.6.0

* Configure line length and move to 'nice to have'

* Also update flake8-bugbear and pin flake8-pyi
2018-10-24 05:53:33 -07:00
Grzegorz Śliwiński
94485f9e4f skip .git files from linting with flake8 (#2506) 2018-10-05 08:29:21 -07:00
Łukasz Langa
6a1d25b73e Document why E741 is ignored 2018-03-28 20:25:50 -07:00
Jelle Zijlstra
5201ccdfff add E741 to ignored flake8 codes (#1999)
This was introduced in a recent version (so it doesn't affect us right now but will if we upgrade the flake8 version used in tests). It gives errors like:
```
/home/travis/build/ambv/flake8-pyi/.tox/typeshed/tmp/typeshed/stdlib/3/re.pyi:21:9: E741 ambiguous variable name 'I'
/home/travis/build/ambv/flake8-pyi/.tox/typeshed/tmp/typeshed/stdlib/3/re.pyi:39:5: E741 ambiguous variable name 'I'
/home/travis/build/ambv/flake8-pyi/.tox/typeshed/tmp/typeshed/stdlib/3/re.pyi:58:5: E741 ambiguous variable name 'I'
/home/travis/build/ambv/flake8-pyi/.tox/typeshed/tmp/typeshed/third_party/2/OpenSSL/crypto.pyi:43:5: E741 ambiguous variable name 'O'
```
These aren't useful for typeshed, because regardless of whether it's good style, these libraries really do contain variables named `I` and `O`.
2018-03-28 20:24:24 -07:00
Svyatoslav Ilinskiy
a249b40a6d Make flake8 not complain about star imports (#1519)
This commit disables following flake8 errors:
* F403: `‘from module import *’ used; unable to detect undefined names`
* F405: `name may be undefined, or defined from star imports: module`

We don't need to worry about undefined names since running mypy_test.py
should detect such undefined names.
2017-08-03 14:26:31 -07:00
Emily Morehouse
85d017d1e8 Documentation updates for testing information (#1293)
- Removes references to 'runtests.sh', as it has been removed
- Adds links from the contributing file to the readme - testing section
- Updates flake8 stats
2017-05-22 16:10:26 -07:00
Guido van Rossum
761ee6afb3 Update configs and instructions for running tests manually. (#1137)
- Switch requirements-tests-py3.txt to use mypy GitHub master.
- Exclude .venv{2,3} (suggested in README.md) in .flake8 and .gitignore.
- Update instructions in README.md to be working.
- Remove runtests.sh script and mentions of it -- I can't get it to work
  and the three steps are easily run by hand.
2017-04-08 19:06:54 -07:00
Lukasz Langa
25a46f42be Switch to Python 3.6 for flake8 runs, re-enable E999 checks 2016-12-22 16:02:46 -08:00
Lukasz Langa
4466a225a6 Upgrade to flake8-pyi 16.12.1
Fixes #786.
2016-12-21 17:30:57 -08:00
Lukasz Langa
092b15e3e9 Mark 92 F821 to go. 2016-12-21 01:31:12 -08:00