-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
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:
- The use of the keyword
excludeinstead ofextend-excludemight 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) - The doc within the
tool.ruff.formatsection ofexcludesays:
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