This PR updates the arguments passed to Ruff to include --force-exclude to make exclusions work. To give some context, if the ruff command is invoked with a filename directly then the exclusions from the config file aren't taken into consideration. When --force-exclude is passed, only then it's used to determine whether to skip running ruff on the given file or not.
From the CLI help menu:
File selection:
--exclude <FILE_PATTERN>
List of paths, used to omit files and/or directories from analysis
--force-exclude
Enforce exclusions, even for paths passed to Ruff directly on the
command-line. Use `--no-force-exclude` to disable
We also use the same when invoking the ruff command via the LSP implementation:
In addition to that, the following changes were made:
Update the documentation link
Use full command-line arguments as it reads better
Use the include the check subcommand as calling ruff via an implicit check command is now deprecated (warning: ruff <path> is deprecated. Use ruff check <path> instead.)
Include .ruff.toml file to determine the current working directory
Hi 👋, thank you for this plugin!
This PR updates the arguments passed to Ruff to include
--force-exclude
to make exclusions work. To give some context, if theruff
command is invoked with a filename directly then the exclusions from the config file aren't taken into consideration. When--force-exclude
is passed, only then it's used to determine whether to skip runningruff
on the given file or not.From the CLI help menu:
We also use the same when invoking the
ruff
command via the LSP implementation:ruff check
command args: https://github.com/astral-sh/ruff-lsp/blob/145e36dbe62b80f0a5682f25782a7038da9a8621/ruff_lsp/server.py#L158ruff format
command args: https://github.com/astral-sh/ruff-lsp/blob/145e36dbe62b80f0a5682f25782a7038da9a8621/ruff_lsp/server.py#L1918In addition to that, the following changes were made:
check
subcommand as callingruff
via an implicit check command is now deprecated (warning:ruff <path>
is deprecated. Useruff check <path>
instead.).ruff.toml
file to determine the current working directory