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

docs: remove . from check and format commands #10217

Merged
merged 5 commits into from Mar 13, 2024

Conversation

hoel-bagard
Copy link
Contributor

Summary

This PR modifies the documentation to use ruff check instead of ruff check ., and ruff format instead of ruff format ., as discussed here

@hoel-bagard hoel-bagard changed the title docs: remove . from check and format commands docs: remove . from check and format commands Mar 3, 2024
Copy link

github-actions bot commented Mar 4, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

docs/formatter.md Outdated Show resolved Hide resolved
Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

Thank you @hoel-bagard for PRing this change.

I'm conflicted on this. While . is not strictly necessary, it shows users how to pass a specific path. Removing the path everywhere might indicate that ruff doesn't accept custom paths. Maybe we leave it in one example and mention that the path can be omitted?

@MichaReiser MichaReiser requested a review from zanieb March 4, 2024 10:01
@hoel-bagard
Copy link
Contributor Author

hoel-bagard commented Mar 4, 2024

@MichaReiser

I'm conflicted on this. While . is not strictly necessary, it shows users how to pass a specific path. Removing the path everywhere might indicate that ruff doesn't accept custom paths.

That was also part of my reasoning when I left it in the preview mode documentation PR. I made this PR to have consistent documentation.

Maybe we leave it in one example and mention that the path can be omitted?

Looking at the documentation, the . is used a lot, but doesn't seem to be explicitly explained that much. There is an explanation here, and examples here, but one might expect a short explanation on how to run ruff on a file/directory to be easier to find.
The note in the ruff check section does link to an explanation with examples, but maybe the note could slightly expand on the fact that ruff check takes a path as input ?

The ruff formatter documentation has an explanation on how to format a single file/directory, using the same example for the linter should be enough, what do you think ?

Co-authored-by: Micha Reiser <micha@reiser.io>
@charliermarsh
Copy link
Member

I think I'd personally prefer to keep these, since in my view at least it's more explicit and clearer for readers that don't know that Ruff defaults to ..

@zanieb
Copy link
Member

zanieb commented Mar 13, 2024

Humph... I want to get rid of these because people think they're needed and they're really not. It degrades the idea that we're a workspace oriented tool. Checking a specific path seems like a less common behavior that we could document separately.

@charliermarsh
Copy link
Member

I defer to you @zanieb.

@zanieb zanieb reopened this Mar 13, 2024
Copy link
Member

@zanieb zanieb left a comment

Choose a reason for hiding this comment

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

Sorry for the back-and-forth, I pushed a couple additional touch-ups and attempted to address Micha's concern.

# Conflicts:
#	docs/installation.md
@zanieb zanieb added the documentation Improvements or additions to documentation label Mar 13, 2024
@zanieb zanieb merged commit 2bf1882 into astral-sh:main Mar 13, 2024
16 checks passed
@hoel-bagard hoel-bagard deleted the hoel/remove_dot_from_docs branch March 13, 2024 23:46
charliermarsh pushed a commit that referenced this pull request Apr 4, 2024
## Summary

Since #10217 the [formatter
docs](https://docs.astral.sh/ruff/formatter/) contained

```
ruff format                   # Format all files in the current directory.
ruff format path/to/code/     # Lint all files in `path/to/code` (and any subdirectories).
ruff format path/to/file.py   # Format a single file.
```

I believe the `Lint` here is a copy-paste typo from the [linter
docs](https://docs.astral.sh/ruff/linter/).

## Test Plan

N/A
Glyphack pushed a commit to Glyphack/ruff that referenced this pull request Apr 12, 2024
## Summary

Since astral-sh#10217 the [formatter
docs](https://docs.astral.sh/ruff/formatter/) contained

```
ruff format                   # Format all files in the current directory.
ruff format path/to/code/     # Lint all files in `path/to/code` (and any subdirectories).
ruff format path/to/file.py   # Format a single file.
```

I believe the `Lint` here is a copy-paste typo from the [linter
docs](https://docs.astral.sh/ruff/linter/).

## Test Plan

N/A
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.

None yet

4 participants