Skip to content

Add pylint missing-await checker - #700

Closed
belm0 wants to merge 4 commits into
python-trio:masterfrom
belm0:pylint_missing_await
Closed

belm0 wants to merge 4 commits into
python-trio:masterfrom
belm0:pylint_missing_await

Conversation

@belm0

@belm0 belm0 commented Sep 30, 2018 •

Copy link
Copy Markdown
Member

pylint support for #671

TODO:

  • fix async generator false positive
  • tests
  • settle error name(s) and code numbers

This runs fine on trio codebase and my own codebase. I haven't looked hard for false negatives.

Run on trio codebase:

PYTHONPATH=. python3 -m pylint --load-plugins=trio.testing.pylint-missing-await --disable=all --enable=missing-await trio/

@belm0
belm0 force-pushed the pylint_missing_await branch from 3e2552f to 7c84dac Compare September 30, 2018 01:39
@codecov

codecov Bot commented Sep 30, 2018 •

Copy link
Copy Markdown

Codecov Report

Merging #700 into master will decrease coverage by 0.1%.
The diff coverage is 84.33%.

@@            Coverage Diff             @@
##           master     #700      +/-   ##
==========================================
- Coverage   99.52%   99.42%   -0.11%     
==========================================
  Files         102      105       +3     
  Lines       12192    12272      +80     
  Branches      904      916      +12     
==========================================
+ Hits        12134    12201      +67     
- Misses         36       48      +12     
- Partials       22       23       +1
Impacted Files Coverage Δ
trio/_subprocess_platform/__init__.py 100% <100%> (ø) ⬆️
trio/tests/pylint-expect-message.py 100% <100%> (ø)
trio/_core/tests/test_run.py 100% <100%> (ø) ⬆️
trio/tests/test_pylint_missing_await.py 75% <75%> (ø)
trio/testing/pylint-missing-await.py 82.05% <82.05%> (ø)

@njsmith

njsmith commented Sep 30, 2018

Copy link
Copy Markdown
Member

It looks like there's a convention of having standalone pylint-{projectname} projects, e.g.:

Maybe we should follow, with a pytest-trio (that would include this, and potentially other lints if we think of any)?

In other news, it looks like py38-dev and astroid have become incompatible, so our CI is currently broken... maybe we should just disable the static analysis tests when sys.version_info.releaselevel != "final"? This isn't the first time we've had trouble with this...

@belm0
belm0 force-pushed the pylint_missing_await branch from 7c84dac to 115d156 Compare February 6, 2019 13:34
@belm0

belm0 commented Feb 6, 2019

Copy link
Copy Markdown
Member Author

fixed false positive from async generators

@belm0
belm0 force-pushed the pylint_missing_await branch from 115d156 to 5b38a11 Compare February 6, 2019 13:50
@belm0
belm0 force-pushed the pylint_missing_await branch 5 times, most recently from 6b123c5 to 9d5c405 Compare April 14, 2019 06:56
typical usage:
    $ pylint --load-plugins=trio.testing.pylint-missing-await --enable=missing-await DIR/
@belm0
belm0 force-pushed the pylint_missing_await branch 3 times, most recently from c28ec3f to ae3b396 Compare April 14, 2019 08:03
@belm0
belm0 force-pushed the pylint_missing_await branch from ae3b396 to 69fba08 Compare April 14, 2019 08:22
@belm0

belm0 commented Apr 14, 2019

Copy link
Copy Markdown
Member Author
  • added tests
  • missing-await run against trio code from check.sh

@Fuyukai

Fuyukai commented Apr 12, 2024

Copy link
Copy Markdown
Member

This is like five years old and the project switched to ruff since. Closing.

@Fuyukai Fuyukai closed this Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants