feat(oxlint): add agent output mode#21955
feat(oxlint): add agent output mode#21955JoviDeCroock wants to merge 4 commits intooxc-project:mainfrom
Conversation
e8fb15f to
5b53011
Compare
|
Thanks for working on this! We have discussed this here: #20514. I think we should rename the formatter to "agent" so that it's clear this is not intended for human eyes. Maybe we'll add a true minimal output in the future too. What do you think? We can also skip the auto enable discussed in that issue for now too. |
5b53011 to
43bd6b2
Compare
|
I was planning on doing the auto-detection as a follow-up 😅 I did not initially see that issue will give that a read, thank you for surfacing it. I applied your feedback, hope this works for you, thank you so much for getting to this so quickly! |
There was a problem hiding this comment.
Note: this looks a lot like stylish format https://github.com/oxc-project/oxc/blob/main/apps/oxlint/src/snapshots/fixtures__cli__output_formatter_diagnostic_--format%3Dstylish%20test.js%40oxlint.snap
There was a problem hiding this comment.
I think that's ok personally, since this allows agent to be more flexible if we think of a way to reduce tokens in the future
There was a problem hiding this comment.
For now, could you please narrow down the scope of this PR to just oxlint?
I think that will make it easier to proceed (, and since oxfmt is not interactive like linter, already outputs minimal information and the code itself seems to have room for improvement.)
yeah, I think this makes sense. let's drop the |
c48eb07 to
82dee84
Compare
Summary
agentformatter with one-line diagnostics and no summary--format agentsupport onlyThis comes in handy when running oxlint from an agent so we can reduce the tokens used.
Tests
INSTA_UPDATE=always cargo test -p oxlint output_formatter::test::test_output_formatter_diagnostic_formats -- --nocapturecargo test -p oxlint agent -- --nocapturecargo test -p website_linter --all-featurescargo test -p website_formatter --all-featuresAI disclosure
Reviewed and opened with assistance from an AI coding agent.