ruff/crates/ruff_python_trivia/src
Charlie Marsh f62b4c801f
Extend pragma comment cases (#7687)
## Summary

Extends the pragma comment detection in the formatter to support
case-insensitive `noqa` (as supposed by Ruff), plus a variety of other
pragmas (`isort:`, `nosec`, etc.).

Also extracts the detection out into the trivia crate so that we can
reuse it in the linter (see:
https://github.com/astral-sh/ruff/issues/7471).

## Test Plan

`cargo test`
2023-09-28 18:55:19 +00:00
..
snapshots Tokenizer: Emit only a single bogus token (#7425) 2023-09-19 16:06:03 +02:00
comment_ranges.rs Use CommentRanges in backwards lexing (#7360) 2023-09-16 03:21:45 +00:00
cursor.rs Use CommentRanges in backwards lexing (#7360) 2023-09-16 03:21:45 +00:00
lib.rs Extend pragma comment cases (#7687) 2023-09-28 18:55:19 +00:00
pragmas.rs Extend pragma comment cases (#7687) 2023-09-28 18:55:19 +00:00
textwrap.rs Remove parser dependency from ruff-python-ast (#6096) 2023-07-26 17:47:22 +02:00
tokenizer.rs Treat form feed as whitespace in SimpleTokenizer (#7626) 2023-09-25 14:34:59 +00:00
whitespace.rs Move Ranged into ruff_text_size (#6919) 2023-08-27 14:12:51 -04:00