mirror of https://github.com/astral-sh/ruff
## Summary When we fall through to parsing, the comment-detection rule is a significant portion of lint time. This PR adds an additional fast heuristic whereby we abort if a comment contains two consecutive name tokens (via the zero-allocation lexer). For the `ctypeslib.py`, which has a few cases that are now caught by this, it's a 2.5x speedup for the rule (and a 20% speedup for token-based rules). |
||
|---|---|---|
| .. | ||
| snapshots | ||
| comment_ranges.rs | ||
| cursor.rs | ||
| lib.rs | ||
| pragmas.rs | ||
| textwrap.rs | ||
| tokenizer.rs | ||
| whitespace.rs | ||