Giter VIP home page Giter VIP logo

Comments (6)

sureshjoshi avatar sureshjoshi commented on May 27, 2024 1

Isn't this what code_quality_tool is for?

But yes, I've agreed with this position for a while :)

from pants.

grihabor avatar grihabor commented on May 27, 2024 1

I thought code_quality_tool is primarily intended for adhoc usage, so it won't show good help, it doesn't support things like ConfigFilesRequest, install_from_resolve, etc.

from pants.

gauthamnair avatar gauthamnair commented on May 27, 2024 1

@kaos @grihabor @sureshjoshi I just took a look at the Sql PR. What code_quality_tool could have done (in the form introduced in #20135 ) is:

  • Provide lint/fix/fmt on *.sql files not targets. It only works against files and so does not have the ability to do things like skip in targets or pull in dependencies of source files. The only way to include/exclude is by file globs.
  • the tool can be any runnable (adhoc-tool compatible). So it can be sqlfluff installed from any particular resolve. You can definitely control the resolve, the same as you would for a python source file or requirement.
  • the tool can accept one or more config file targets, but the user has to configure that explicitly themselves via Targets.
  • the pants help you get for a code quality tool is very minimal.

CodeQualityTool is for when you have a runnable and just want to lint/fmt/fix with it. It is intended for use by users rather than by plugin authors. The sql support added in #20854 would not be improved by it. In fact it is unclear how to provide a plugin through code quality tool.

For another look at trying to reduce the boilerplate that plugin authors face, you can also check out what @lilatomic was piloting back in #16412

For a kind of long-form treatise on the matter there is https://docs.google.com/presentation/d/15P0YdoX1T4fX0DpNzwwXxP1bMVZqUZ_GB9Jkn3rQwRQ/edit#slide=id.p

from pants.

kaos avatar kaos commented on May 27, 2024

Isn't this what code_quality_tool is for?

Ah, you're absolutely right. I forgot about that one. Perhaps revisit #20854 to see if it can be implemented using that..? (cc @grihabor)

from pants.

kaos avatar kaos commented on May 27, 2024

Good point. (I've not looked much at it, so I have no good sense of its current limitations)

I thought code_quality_tool is primarily intended for adhoc usage

That may perhaps be the current state of it is best suited for..

so it won't show good help, it doesn't support things like ConfigFilesRequest, install_from_resolve, etc.

.. yet. I think we'd like to build upon it to make it suitable for less adhoc use as well. But if it's not feature complete enough for the sqlfluff tool today, let's proceed with the work in #20854 as is for now :)

cc @gauthamnair could perhaps fill in more details here..

from pants.

kaos avatar kaos commented on May 27, 2024

Thanks for the details @gauthamnair, that all makes sense.

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.