treefmt: add python linting because ruff format doesn't do everything #70

Merged
jade merged 1 commit from just1602/flake-compat:add-python-lint-treefmt into main 2025-03-26 16:06:20 +00:00
Member

@cobaltcause point out on matrix that ruff format doesn't order imports,
and doesn't run lints.

This commit add a new treefmt formatter to lint the code (for now only
order imports), but more lints could be enable. I tried to enable ALL,
but it's too much and enforce docstring and stuff we may don't want
especially for a testsuite.

@cobaltcause point out on matrix that `ruff format` doesn't order imports, and doesn't run lints. This commit add a new treefmt formatter to lint the code (for now only order imports), but more lints could be enable. I tried to enable `ALL`, but it's too much and enforce docstring and stuff we may don't want especially for a testsuite.
Charles point out on matrix that `ruff format` doesn't order imports,
and doesn't run lints.

This commit add a new treefmt formatter to lint the code (for now only
order imports), but more lint could be enable. I tried to enable `ALL`,
but it's too much and enforce docstring and stuff we may don't want
especially for a testsuite.
just1602 force-pushed add-python-lint-treefmt from 847adf2d1b to b582fd9a71 2025-03-26 04:03:01 +00:00 Compare
treefmt.toml Outdated
@ -9,0 +11,4 @@
# complain about a lot of things for now.
[formatter.python-lint]
command = "ruff"
options = ["check", "--fix", "--select", "I"]
Owner

should be in pyproject.toml instead so ruff gets the right settings when used from elsewhere. otherwise this is ok.

should be in pyproject.toml instead so ruff gets the right settings when used from elsewhere. otherwise this is ok.
just1602 force-pushed add-python-lint-treefmt from b582fd9a71 to c5dd2240ab 2025-03-26 15:29:04 +00:00 Compare
Author
Member

Oh, TIL. I don't do a lot of python anymore except for small script, but this is really cool to be able to set stuff up in pyproject.toml like that.

Oh, TIL. I don't do a lot of python anymore except for small script, but this is really cool to be able to set stuff up in `pyproject.toml` like that.
jade approved these changes 2025-03-26 16:06:15 +00:00
jade merged commit 0c79ecade7 into main 2025-03-26 16:06:20 +00:00
just1602 deleted branch add-python-lint-treefmt 2025-03-26 18:00:19 +00:00
Sign in to join this conversation.
No description provided.