Open linjer opened 6 months ago
I would also find this helpful. An initial work around:
rye add --dev ruff
pyproject.toml
[tool.rye.scripts]
check-lint = "ruff check"
Does chain
do what you need? https://rye.astral.sh/guide/pyproject/#chain
# pyproject.toml
[tool.rye.scripts]
lint = { chain = ["lint:black", "lint:flake8"] }
"lint:black" = "black --check src"
"lint:flake8" = "flake8 src"
Then:
rye lint
: runs Ruffrye run lint
: runs the above scripts@jamesbraza I want to keep the rye lint
command that runs ruff, but also run mypy
, and allow people to continue using rye lint
in their workflows.
Are you suggesting a workaround where I redefine what rye lint
does in a new command (e.g., lint:ruff
) that can be chained? This is how I understood asmith26's suggestion.
Oh @linjer thanks for following up. Yeah your ideal was basically overriding rye lint
such that rye lint
runs Ruff, mypy
, and possibly other tools. I like your request, it makes sense.
You're correct that my comment didn't resolve that directly, it instead adds an additional script called lint
(invoked via rye run lint
) that calls other tools
Currently interested in chaining or extending the
rye lint
command to also perform typechecking. For example:This seems to fail because
rye
is not available in the environment. I also could not find any documentation on if I could customize thelint
command.Suggestion
Make rye native commands accessible to scripts.