trio icon indicating copy to clipboard operation
trio copied to clipboard

Enable flake8 annotations

Open CoolCat467 opened this issue 1 year ago • 4 comments

In this pull request, we enable ruff's flake8-annotations rule.

One of the more major things this rule complains about is missing type annotations on self and cls arguments, so there are a lot of places that got Self and type[Self] annotations added respectfully, as there is not a way to specifically ignore self or cls in particular without missing others.

CoolCat467 avatar Sep 29 '24 02:09 CoolCat467

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.63%. Comparing base (c7801ae) to head (cf7df04). Report is 19 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3098   +/-   ##
=======================================
  Coverage   99.63%   99.63%           
=======================================
  Files         122      122           
  Lines       18380    18380           
  Branches     1222     1222           
=======================================
  Hits        18312    18312           
  Misses         47       47           
  Partials       21       21           
Files with missing lines Coverage Δ
src/trio/_channel.py 100.00% <ø> (ø)
src/trio/_core/_instrumentation.py 100.00% <100.00%> (ø)
src/trio/_core/_mock_clock.py 100.00% <100.00%> (ø)
src/trio/_core/_run.py 99.02% <ø> (ø)
src/trio/_dtls.py 97.50% <100.00%> (ø)
src/trio/_file_io.py 100.00% <100.00%> (ø)
src/trio/_highlevel_socket.py 100.00% <100.00%> (ø)
src/trio/_repl.py 100.00% <100.00%> (ø)
src/trio/_socket.py 100.00% <100.00%> (ø)
src/trio/_subprocess_platform/__init__.py 100.00% <100.00%> (ø)
... and 12 more

codecov[bot] avatar Sep 29 '24 02:09 codecov[bot]

Actually, the self/cls issue is because this is enabling the deprecated ANN101/ANN102 rules. Those should be disabled. Also, I really don't see the point anyway in running any of our linters on notes-to-self. Those are just historical test/example scripts, they're not supposed to be robust or anything. It just produces churn...

Did a force push basically redoing everything, much easier than manually undoing adding self everywhere

CoolCat467 avatar Sep 29 '24 07:09 CoolCat467

Actually, the self/cls issue is because this is enabling the deprecated ANN101/ANN102 rules. Those should be disabled. Also, I really don't see the point anyway in running any of our linters on notes-to-self. Those are just historical test/example scripts, they're not supposed to be robust or anything. It just produces churn...

tbh, is there any reason to keep them around at all anymore? We could dump them in a gist and save a link somewhere if we want to save them somewhere (other than in the git history)

jakkdl avatar Oct 17 '24 09:10 jakkdl

Could create a git tag to mark which commit is is with the last version.

TeamSpen210 avatar Oct 17 '24 10:10 TeamSpen210

Planning on merging this in a day or two unless anyone has any other comments.

CoolCat467 avatar Nov 03 '24 04:11 CoolCat467