ruff icon indicating copy to clipboard operation
ruff copied to clipboard

I suggest creating a metacode-compatible parser

Open pomponchik opened this issue 2 months ago • 1 comments

Question

Hi!

I recently created a comment parser that can be used in any linters and formatters: metacode. I suggest this as a convenient standard, since different tools are now forced to implement such parsers from scratch. And I suggest that ruff, as the flagship of all python linters, support this standard.

Given that Ruff is not written in Python, I suggest implementing a separate grammar-based mini-parser using Rust.

Version

No response

pomponchik avatar Dec 16 '25 03:12 pomponchik

Can you say more about what the benefits are for ruff? We don't need a "can parse all pragma comments" parser, we only need to parse the few comments supported by Ruff. Or are there cases where Ruff's parser doesn't follow your meta grammar?

MichaReiser avatar Dec 16 '25 07:12 MichaReiser