Skip to content

Update ruff and enable more ruff checks. NFC - #1833

Merged
sbc100 merged 1 commit into
mainfrom
ruff-sim-furb-ret
Dec 2, 2026
Merged

sbc100 merged 1 commit into
mainfrom
ruff-sim-furb-ret

Conversation

@sbc100

@sbc100 sbc100 commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator
  • Bump ruff to 0.17.6 in requirements-dev.txt.
  • Enable FURB, RET, and SIM in pyproject.toml (ignoring uncapitalized-environment-variables, if-else-block-instead-of-if-exp, read-whole-file, write-whole-file, and superfluous-else-return), and fix existing violations across emsdk.py, test/test.py, scripts/, and bazel/.
  • Annotate exit_with_error as NoReturn so implicit-return recognizes it does not return, and remove cmp_version and passes_filters (unused since Replace optional Tools fields (using hasattr) with normal class fields. NFC #1710) from emsdk.py.

- Bump `ruff` to `0.17.6` in `requirements-dev.txt`.
- Enable `FURB`, `RET`, and `SIM` in `pyproject.toml` (ignoring
  `uncapitalized-environment-variables`,
  `if-else-block-instead-of-if-exp`, `read-whole-file`,
  `write-whole-file`, and `superfluous-else-return`), and fix existing
  violations across `emsdk.py`, `test/test.py`, `scripts/`, and
  `bazel/`.
- Annotate `exit_with_error` as `NoReturn` so `implicit-return`
  recognizes it does not return, and remove `cmp_version` and
  `passes_filters` (unused since #1710) from `emsdk.py`.
@sbc100
sbc100 requested a review from juj December 2, 2026 08:03
Comment thread emsdk.py
def load_releases_versions():
info = load_releases_info()
versions = list(info['releases'].keys())
return versions

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like something is lost if it's not allowable to name the variable that is being returned, but I guess if it's in ruff, it's somehow pythonic, so ok I guess..

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can override this if we line. But also the name of the function is kind of enough in this case I think.

@sbc100
sbc100 merged commit 8affc22 into main Dec 2, 2026
10 checks passed
@sbc100
sbc100 deleted the ruff-sim-furb-ret branch December 2, 2026 16:11
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.

2 participants