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

Update tutorial to match revised Ruff defaults #8066

Merged
merged 3 commits into from
Oct 19, 2023
Merged

Conversation

charliermarsh
Copy link
Member

Summary

We don't enable E501 by default, but line-length is a useful example for configuration, so we now set --extend-select in the tutorial with a note to that effect.

I've also updated all the outputs to match the latest CLI behavior, and changed the example from List to Sequence because List now spits out two diagnostics (one for the import, one for the usage), which IMO is confusing for beginners.

@charliermarsh charliermarsh requested a review from zanieb October 19, 2023 15:59
@charliermarsh charliermarsh added the documentation Improvements or additions to documentation label Oct 19, 2023
README.md Outdated
stylistic rules made obsolete by the use of a formatter, like
[Black](https://github.com/psf/black).
By default, Ruff enables Flake8's `F` rules, along with a subset of the `E` rules, omitting any
stylistic rules that conflict with the use of a formatter, like [Black](https://github.com/psf/black).
Copy link
Member

Choose a reason for hiding this comment

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

perhaps "overlap" instead of "conflict"?

docs/tutorial.md Outdated
@@ -16,13 +16,13 @@ numbers
Where `numbers.py` contains the following code:

```py
from typing import List
from typing import Sequence
Copy link
Member

Choose a reason for hiding this comment

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

Not really important for this to be a sequence is it? Wouldn't Iterable be proper?

Copy link
Member

Choose a reason for hiding this comment

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

Oh sorry I see you changed this to avoid additional diagnostics — it's fine as Sequence

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks!

Copy link
Member Author

Choose a reason for hiding this comment

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

Iterable works just as well.

@charliermarsh charliermarsh merged commit cdc5e2f into main Oct 19, 2023
15 checks passed
@charliermarsh charliermarsh deleted the charlie/tutorial branch October 19, 2023 16:27
@github-actions
Copy link
Contributor

PR Check Results

Ecosystem

✅ ecosystem check detected no changes.

zanieb added a commit that referenced this pull request Oct 19, 2023
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants