ruff/crates
Dhruv Manilawala 47d80f29a7
Lexer start of line is false only for Mode::Expression (#8880)
## Summary

This PR fixes the bug in the lexer where the `Mode::Ipython` wasn't
being considered when initializing the soft keyword transformer which
wraps the lexer. This means that if the source code starts with either
`match` or `type` keyword, then the keywords were being considered as
name tokens instead. For example,

```python
match foo:
    case bar:
        pass
```

This would transform the `match` keyword into an identifier if the mode
is `Ipython`.

The fix is to reverse the condition in the soft keyword initializer so
that any new modes are by default considered as the lexer being at start
of line.

## Test Plan

Add a new test case for `Mode::Ipython` and verify the snapshot.

fixes: #8870
2023-11-28 20:38:25 +00:00
..
flake8_to_ruff Bump configparser from 3.0.2 to 3.0.3 (#8849) 2023-11-27 10:07:22 +00:00
ruff_benchmark Bump codspeed-criterion-compat from 2.3.1 to 2.3.3 (#8784) 2023-11-20 11:10:48 +00:00
ruff_cache Update to Rust 1.74 and use new clippy lints table (#8722) 2023-11-16 18:12:46 -05:00
ruff_cli Factor out a builder to handle common integration test arguments (#8733) 2023-11-22 00:32:01 +00:00
ruff_dev Update ruff-dev to use SourceKind (#8878) 2023-11-28 14:27:35 -06:00
ruff_diagnostics Update applicability messages for clarity in tests (#8541) 2023-11-07 16:11:43 +00:00
ruff_formatter remove several uses of unsafe (#8600) 2023-11-28 09:50:03 -05:00
ruff_index Update to Rust 1.74 and use new clippy lints table (#8722) 2023-11-16 18:12:46 -05:00
ruff_linter [isort] Add support for length-sort settings (#8841) 2023-11-28 06:00:37 +00:00
ruff_macros remove several uses of unsafe (#8600) 2023-11-28 09:50:03 -05:00
ruff_notebook Avoid B015,B018 for last expression in a cell (#8815) 2023-11-22 15:33:23 +00:00
ruff_python_ast Remove #[allow(unused_variables)] from visitor methods (#8828) 2023-11-25 00:09:46 +00:00
ruff_python_codegen Update string nodes for implicit concatenation (#7927) 2023-11-24 17:55:41 -06:00
ruff_python_formatter remove several uses of unsafe (#8600) 2023-11-28 09:50:03 -05:00
ruff_python_index Update to Rust 1.74 and use new clippy lints table (#8722) 2023-11-16 18:12:46 -05:00
ruff_python_literal remove several uses of unsafe (#8600) 2023-11-28 09:50:03 -05:00
ruff_python_parser Lexer start of line is false only for Mode::Expression (#8880) 2023-11-28 20:38:25 +00:00
ruff_python_resolver Update to Rust 1.74 and use new clippy lints table (#8722) 2023-11-16 18:12:46 -05:00
ruff_python_semantic Update to Rust 1.74 and use new clippy lints table (#8722) 2023-11-16 18:12:46 -05:00
ruff_python_stdlib Update to Rust 1.74 and use new clippy lints table (#8722) 2023-11-16 18:12:46 -05:00
ruff_python_trivia Update to Rust 1.74 and use new clippy lints table (#8722) 2023-11-16 18:12:46 -05:00
ruff_shrinking Bump version to v0.1.6 (#8744) 2023-11-17 13:29:19 -05:00
ruff_source_file remove several uses of unsafe (#8600) 2023-11-28 09:50:03 -05:00
ruff_text_size Update to Rust 1.74 and use new clippy lints table (#8722) 2023-11-16 18:12:46 -05:00
ruff_wasm Bump wasm-bindgen-test from 0.3.37 to 0.3.38 (#8847) 2023-11-27 10:02:53 +00:00
ruff_workspace [isort] Add support for length-sort settings (#8841) 2023-11-28 06:00:37 +00:00