ruff/crates/ruff_python_trivia/src
Charlie Marsh 646ff6497c
Ignore end-of-line file exemption comments (#6160)
## Summary

This PR protects against code like:

```python
from typing import Optional

import bar  # ruff: noqa
import baz

class Foo:
    x: Optional[str] = None
```

In which the user wrote `# ruff: noqa` to ignore a specific error, not
realizing that it was a file-level exemption that thus turned off all
lint rules.

Specifically, if a `# ruff: noqa` directive is not at the start of a
line, we now ignore it and warn, since this is almost certainly a
mistake.
2023-07-29 00:40:32 +00:00
..
snapshots SimpleTokenizer: Fix infinite loop when lexing empty quotes (#5917) 2023-07-20 15:18:35 +02:00
cursor.rs Rename ruff_python_whitespace to ruff_python_trivia (#5886) 2023-07-19 11:48:27 -04:00
lib.rs Remove parser dependency from ruff-python-ast (#6096) 2023-07-26 17:47:22 +02:00
textwrap.rs Remove parser dependency from ruff-python-ast (#6096) 2023-07-26 17:47:22 +02:00
tokenizer.rs Remove parser dependency from ruff-python-ast (#6096) 2023-07-26 17:47:22 +02:00
whitespace.rs Ignore end-of-line file exemption comments (#6160) 2023-07-29 00:40:32 +00:00