Comments (1)
I want to explain my motivation here: I tried using new ruff formatter (pants release 2.20.0dev3) along with ruff checker. It uses the same tool_subsystem = Ruff
and therefore the same tool_id = "ruff"
. This makes it impossible to turn off the ruff formatter, but not the ruff checker.
My first idea was to make pants fix
respect [fmt].only
parameter, this way I could set [fmt].only=['black']
and run pants fix
and it will only run ruff check --fix
and not ruff format
. But now I'm not sure it's a good idea, because [fmt]
is dedicated to the fmt
goal, it's not clear why fix
goal should respect fmt
subsystem. The same logic also applies to lint
goal, if fix
goal respects [fmt]
then lint
goal should also respect [fmt]
, right? It all looks weird, so I think the right solution is to change tool_id
for ruff:
class RuffFixRequest(FixTargetsRequest):
tool_id = 'ruff-check'
...
class RuffFormatRequest(FmtTargetsRequest):
tool_id = 'ruff-format'
...
This will solve the issue and keep the current lint/format/fix structure.
from pants.
Related Issues (20)
- `peek` documentation example output is outdated/incomplete
- `peek` output for target generators like `python_tests` do not include relevant `goals` HOT 3
- "Making subsystems exportable with their default lockfile" docs render funny
- Project specific env vars from host
- `export` goal `py_hermetic_scripts` option docs have misrendered list
- Plugin upgrade guide does not mention changes in 2.18 or later (e.g. `@rule_helper` removal) HOT 1
- pantsd not invalidating cache when file permission changes
- Consistent option hierarchy
- Add exit-non-zero-on-fix support for fix and fmt goals HOT 10
- Pants package command hangs for helm chart with dependency subcharts of the same name HOT 1
- Show Python tool versions in top-level help text and documentation
- Feature request: Allow disabling file handle limit warning HOT 2
- `__defaults__(all=...)` is a future-compatibility hazard for adding new field HOT 4
- Process 'Extract Pants' execution Python' failed with exit code 2, when running in GH actions HOT 3
- Overrides not working with parametrized default HOT 2
- GitHub-hosted `macos-11` runners are deprecated and will be removed on 2024-06-28
- Pants test using a different module version than it's assigned resolve HOT 3
- Values from `__defaults__` are not treated the same as builtin field defaults.
- Lingering TODO about removing `parent_id` in `interface.rs`
- Regression: env vars no longer being parsed correctly in `pants.toml` as of Pants `2.22.0.dev2` HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pants.