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

Confusing note on exclude option in tool.ruff.format #8301

Closed
Giuzzilla opened this issue Oct 28, 2023 · 1 comment
Closed

Confusing note on exclude option in tool.ruff.format #8301

Giuzzilla opened this issue Oct 28, 2023 · 1 comment

Comments

@Giuzzilla
Copy link
Contributor

Giuzzilla commented Oct 28, 2023

I was checking the various options for tool.ruff.format and in particular I wanted to add additional exclusions to the formatter (in addition to the exclusions in tool.ruff.

The documentation of this option can be found at: https://docs.astral.sh/ruff/settings/#format-exclude

The documentation correctly says

A list of file patterns to exclude from formatting in addition to the files excluded globally.

I had two doubts about this:

  1. The use of the keyword exclude instead of extend-exclude might make you think that this list is not "additive" / on top of the global one. (changing this would be a kind of breaking change though and the current behaviour is documented)
  2. The doc within the tool.ruff.format section of exclude says:

Note that you'll typically want to use extend-exclude to modify the excluded paths.

However, no such option is available for the formatter so one might confuse the tool.ruff.format.exclude behavior with the behaviour of the global tool.ruff.exclude (which is not additive). This text seems to be a copy-paste from the global exclude option documentation

@Giuzzilla
Copy link
Contributor Author

Giuzzilla commented Oct 28, 2023

Maybe it's better to discuss point (1) on the relevant discussion of the formatter: #7310 (comment)

@Giuzzilla Giuzzilla changed the title Confusing note on exclude option in tool.ruff.format? Confusing note on exclude option in tool.ruff.format Oct 28, 2023
@Giuzzilla Giuzzilla reopened this Oct 28, 2023
charliermarsh pushed a commit that referenced this issue Oct 28, 2023
…mat` config docs (#8302)

## Summary

Remove wrong note on `tool.ruff.format` `exclude` option from
documentation which is referencing `extend-exclude` even if it's not
relevant for the formatter options (`exclude` is additive). See #8301

## Test Plan

N/A (Docs change)
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

No branches or pull requests

1 participant