Skip to content

Conversation

@henryiii
Copy link
Contributor

This is the ruff EM check, based on flake8-errmsg (my package). It changes tracebacks from this:

Traceback (most recent call last):
  File "tmp.py", line 2, in <module>
    raise RuntimeError(f"{sub!r} is incorrect")
RuntimeError: 'Some value' is incorrect

to this:

Traceback (most recent call last):
  File "tmp.py", line 3, in <module>
    raise RuntimeError(msg)
RuntimeError: 'Some value' is incorrect

This avoids printing the error message twice, sometimes with placeholders. It also tends to format a little nicer.

It's a ruff autofix, so was easy to apply. We don't have to if people don't like it.

@brettcannon
Copy link
Member

I personally don't care either way.

@henryiii henryiii force-pushed the henryiii/chore/ruff-EM branch from 4fecf58 to c1507b9 Compare November 18, 2025 23:03
Signed-off-by: Henry Schreiner <[email protected]>
@henryiii henryiii force-pushed the henryiii/chore/ruff-EM branch from c1507b9 to 1a31339 Compare November 19, 2025 21:41
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