Skip to content
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

Documentation mismatch between ruff and docs for f-string-in-exception #12504

Closed
UriyaHarpeness opened this issue Jul 25, 2024 · 3 comments
Closed
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@UriyaHarpeness
Copy link
Contributor

This is a documentation issue, not related to the logic.
This issue is relevant for the current version: 0.5.4.

In https://docs.astral.sh/ruff/rules/f-string-in-exception/ there's a section that shows the traceback before and after, in the after one it does not include the first line of the traceback.

I wanted to open a PR to add the missing line, but when opening the code docstrings it seemed to already include that line:

/// Which will produce a traceback like:
/// ```console
/// Traceback (most recent call last):
/// File "tmp.py", line 3, in <module>
/// raise RuntimeError(msg)
/// RuntimeError: 'Some value' is incorrect

I went to the docs repo, and there the first line was missing:
https://github.com/astral-sh/docs/blob/main/site/ruff/rules/f-string-in-exception/index.html#L827-L830

I don't know what the source of this mismatch is, but seemed that just opening a manual change to the generated docs is not the way to go. So here I am opening an issue.

@dhruvmanila
Copy link
Member

I think it's the other rule (in the same file) which has a missing traceback header ;)

/// Which will produce a traceback like:
/// ```console
/// File "tmp.py", line 3, in <module>
/// raise RuntimeError(msg)
/// RuntimeError: 'Some value' is incorrect

@dhruvmanila dhruvmanila added documentation Improvements or additions to documentation good first issue Good for newcomers labels Jul 25, 2024
@UriyaHarpeness
Copy link
Contributor Author

Sigh... my bad, I'll open a PR soon.
Thanks.

charliermarsh pushed a commit that referenced this issue Jul 25, 2024
)

## Summary

Add missing traceback line in `f-string-in-exception` docstring.

Solves #12504.
@charliermarsh
Copy link
Member

Closed by #12508.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants