Giter Site home page Giter Site logo

Comments (1)

grihabor avatar grihabor commented on May 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.