ruff/crates/ruff_python_formatter
konstin 209aaa5add
Ensure type_ignores for Module are empty (#4861)
According to https://docs.python.org/3/library/ast.html#ast-helpers, we expect type_ignores to be always be empty, so this adds a debug assert.

Test plan: I confirmed that the assertion holdes for the file below and for all the black tests which include a number of `type: ignore` comments.
```python
# type: ignore

if 1:
    print("1")  # type: ignore
    # elsebranch

# type: ignore

else:  # type: ignore
    print("2")  # type: ignore

while 1:
    print()

# type: ignore
```
2023-06-05 11:38:08 +02:00
..
resources/test/fixtures Format while Statement (#4810) 2023-06-05 08:24:00 +00:00
src Ensure type_ignores for Module are empty (#4861) 2023-06-05 11:38:08 +02:00
Cargo.toml Move universal newline handling into its own crate (#4729) 2023-05-31 12:00:47 -04:00
Docs.md Generate FormatRule definitions (#4724) 2023-06-01 08:38:53 +02:00
generate.py Use dummy verbatim formatter for all nodes (#4755) 2023-06-01 08:25:26 +00:00
orphan_rules_in_the_formatter.svg Generate FormatRule definitions (#4724) 2023-06-01 08:38:53 +02:00