-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PoC of gritql integration #12
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
… are not accurate enough yet
OpenAI before & after testsAll results without OpenAI gptlint results with grit
OpenAI gptlint results without grit
OpenAI eval results with grit
OpenAI eval results without grit
AnalysisThe eval results are roughly the same, which makes sense because all of the generated evals are purposefully minimal, and The more interesting comparison is the results of running the linter on the Overall, these results aren't as significant as I was expecting, but filtering out source files with no matches does provide a significant cost reduction, and I expect this difference to be proportional to the size of the codebase. Also, there are a lot of the built-in rules which are still sending too much context to the LLM, and several of the rules don't use I was a bit surprised that the |
Also interesting to note that the |
gptlint
😊This PR adds an optional dependency on the Rust-based
grit
binary via the@getgrit/launcher
npm package.Goals of adding
gritql
:file
-scoped rules to optionally specifygritql
patterns to extract more focused source code context for the LLM-based linter to work withgritql
wrapstree-sitter
and a bunch oftree-sitter
wasm grammers, which are generally a pain to deal with (see my exploration here for more details and alternatives), so one potential upside of usinggritql
is that it will make cross-language and multi-file-context support a lot easier vs usingtree-sitter
directlygritql
also natively supports specifying before & after code transforms in their pattern syntax via the=>
operator. when we do end up tacklingautofix
, this could be a useful, more deterministic tool to augment LLM-based code editing for many built-in rulesMost of these goals still need to be quantified and tested in real-world repos as well as our evals before we consider merging. I'm not sure if we'll include this in the MVP with our goal of launching next week, but given how large of an impact this could potentially have, I was excited to explore this direction to understand viability and quantify the potential impact.
See also getgrit/gritql#214. If we end up adopting this approach, we'll likely want to use a more generally compatible solution as opposed to running
grit
as a subprocess, but this would be good enough for the purposes of this PoC for now.