Skip to content

Refactoring: Force ruff static checker for project #639

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

penguinolog
Copy link
Collaborator

  • do not use assert in production code
  • package files are not executable
  • use isinstance
  • stop checks like if boolean == True: ...
  • use contextlib.suppress
  • explicit return None in optionals
  • reduce amount of shadowed keywords (next, ...)
Checklist
  • I've ensured that similar functionality has not already been implemented
  • I've ensured that similar functionality has not earlier been proposed and declined
  • I've branched off the master or python-dual-support branch
  • I've merged fresh upstream into my branch recently
  • I've ran tox successfully in local environment
  • I've included docstrings and/or documentation and/or examples for my code (if this is a new feature)

* do not use `assert` in production code
* package files are not executable
* use `isinstance`
* stop checks like `if boolean == True: ...`
* use `contextlib.suppress`
* explicit return `None` in optionals
* reduce amount of shadowed keywords (`next`, ...)
@coveralls
Copy link

Pull Request Test Coverage Report for Build 6323621144

  • 203 of 418 (48.56%) changed or added relevant lines in 11 files are covered.
  • 6 unchanged lines in 4 files lost coverage.
  • Overall coverage increased (+0.3%) to 74.386%

Changes Missing Coverage Covered Lines Changed/Added Lines %
urwid/monitored_list.py 0 1 0.0%
urwid/signals.py 2 3 66.67%
urwid/vterm.py 22 30 73.33%
urwid/display_common.py 17 26 65.38%
urwid/util.py 14 24 58.33%
urwid/text_layout.py 45 66 68.18%
urwid/canvas.py 59 82 71.95%
urwid/listbox.py 38 71 53.52%
urwid/treetools.py 1 47 2.13%
urwid/raw_display.py 3 66 4.55%
Files with Coverage Reduction New Missed Lines %
urwid/canvas.py 1 84.95%
urwid/display_common.py 1 73.23%
urwid/text_layout.py 1 87.5%
urwid/treetools.py 3 20.9%
Totals Coverage Status
Change from base Build 6311553324: 0.3%
Covered Lines: 7518
Relevant Lines: 10290

💛 - Coveralls

@penguinolog penguinolog merged commit 9e72578 into urwid:master Sep 27, 2023
@penguinolog penguinolog deleted the ruff branch September 27, 2023 08:55
@ulidtko
Copy link
Collaborator

ulidtko commented Sep 27, 2023

@penguinolog you should give more time for code review. 4 minutes between opening a +755 −698 PR and insta-merging it — is not sufficient to post even a short comment.

@penguinolog
Copy link
Collaborator Author

I agree, but this PR from hell was 90% automatically generated

@ulidtko
Copy link
Collaborator

ulidtko commented Sep 27, 2023

That's even worse.

Source code is for humans to read.

@neiljp
Copy link

neiljp commented Oct 25, 2023

It's great to see this extra linting of the project, but I'd agree re reviewing. Personally, I'd break these automated changes into multiple commits, each linting/fixing additional aspects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants