Comments (6)
Isn't this what code_quality_tool
is for?
But yes, I've agreed with this position for a while :)
from pants.
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.
@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.
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.
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.
Thanks for the details @gauthamnair, that all makes sense.
from pants.
Related Issues (20)
- Add support for buildifier style in BUILD files, or support running an auto-format binary after `pants tailor` HOT 7
- pants `dependencies` and `dependents` goals with `--format=json` don't respect `--output-file`
- BUILD couldn't be created in a directory which contains a directory called build HOT 1
- 2.21 release preparation HOT 2
- Built-in lockfiles won't work with Python 3.13, due to pip version
- Publish SchemaStore schema for Pants 2.20.0 HOT 1
- Cryptic error when `package.json` is missing a name HOT 1
- Lint using code_quality_tool fails
- Can't export virtualenv HOT 1
- allow configuration to disable generation of shunit2_tests targets
- `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
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.