Charlie Marsh
6a5acde226
Make Parameters an optional field on ExprLambda ( #6669 )
...
## Summary
If a lambda doesn't contain any parameters, or any parameter _tokens_
(like `*`), we can use `None` for the parameters. This feels like a
better representation to me, since, e.g., what should the `TextRange` be
for a non-existent set of parameters? It also allows us to remove
several sites where we check if the `Parameters` is empty by seeing if
it contains any arguments, so semantically, we're already trying to
detect and model around this elsewhere.
Changing this also fixes a number of issues with dangling comments in
parameter-less lambdas, since those comments are now automatically
marked as dangling on the lambda. (As-is, we were also doing something
not-great whereby the lambda was responsible for formatting dangling
comments on the parameters, which has been removed.)
Closes https://github.com/astral-sh/ruff/issues/6646 .
Closes https://github.com/astral-sh/ruff/issues/6647 .
## Test Plan
`cargo test`
2023-08-18 15:34:54 +00:00
..
2023-07-19 13:01:58 +02:00
2023-06-30 06:32:50 +00:00
2023-08-01 08:26:30 +02:00
2023-07-11 06:08:08 +00:00
2023-08-14 12:28:58 +00:00
2023-08-01 08:26:30 +02:00
2023-07-11 16:40:28 +02:00
2023-08-01 08:26:30 +02:00
2023-06-30 06:32:50 +00:00
2023-08-01 08:26:30 +02:00
2023-08-16 15:05:51 +00:00
2023-07-29 10:06:26 -04:00
2023-08-16 08:31:25 +05:30
2023-08-16 08:31:25 +05:30
2023-08-16 08:31:25 +05:30
2023-08-16 08:31:25 +05:30
2023-08-16 08:31:25 +05:30
2023-07-19 13:01:58 +02:00
2023-08-16 08:31:25 +05:30
2023-07-24 07:04:40 +00:00
2023-06-30 06:32:50 +00:00
2023-08-15 07:15:33 -04:00
2023-08-15 18:59:18 +00:00
2023-07-31 16:58:15 -04:00
2023-08-03 20:45:03 +00:00
2023-08-03 20:45:03 +00:00
2023-08-14 12:28:58 +00:00
2023-08-01 08:26:30 +02:00
2023-08-04 13:58:01 +00:00
2023-08-14 15:57:36 +00:00
2023-08-14 15:57:36 +00:00
2023-08-17 05:58:19 +00:00
2023-07-11 16:51:24 +02:00
2023-08-01 15:30:59 +00:00
2023-08-04 13:58:01 +00:00
2023-07-26 16:21:23 +00:00
2023-08-15 18:59:18 +00:00
2023-08-15 18:59:18 +00:00
2023-07-10 21:23:49 +02:00
2023-07-19 11:47:56 +00:00
2023-08-01 08:26:30 +02:00
2023-08-15 18:59:18 +00:00
2023-08-08 08:45:20 -04:00
2023-07-11 14:07:39 +02:00
2023-07-14 09:01:33 +02:00
2023-07-31 10:46:40 +02:00
2023-06-30 06:32:50 +00:00
2023-06-30 10:13:23 +02:00
2023-08-14 12:28:58 +00:00
2023-07-11 16:40:28 +02:00
2023-08-15 18:59:18 +00:00
2023-08-07 12:22:33 -05:00
2023-08-08 09:15:35 +00:00
2023-08-07 12:22:33 -05:00
2023-07-31 10:46:40 +02:00
2023-08-15 18:59:18 +00:00
2023-08-11 17:58:42 +00:00
2023-08-08 08:45:20 -04:00
2023-08-08 09:15:35 +00:00
2023-08-11 09:22:30 +02:00
2023-08-15 18:59:18 +00:00
2023-07-10 15:55:19 +02:00
2023-08-18 15:34:54 +00:00
2023-08-04 14:00:54 +00:00
2023-08-08 08:45:20 -04:00
2023-08-18 03:10:45 +00:00
2023-07-20 10:07:22 +00:00
2023-07-20 15:05:18 +00:00
2023-08-11 17:58:42 +00:00
2023-08-16 13:41:07 +00:00
2023-07-31 19:25:16 +02:00
2023-08-16 13:20:48 +00:00
2023-07-11 14:07:39 +02:00
2023-07-21 12:07:51 +00:00
2023-08-16 13:41:07 +00:00
2023-08-15 08:00:35 +02:00
2023-08-14 15:57:36 +00:00
2023-08-15 08:00:35 +02:00
2023-08-14 15:57:36 +00:00
2023-08-15 08:00:35 +02:00
2023-08-14 15:57:36 +00:00
2023-08-15 08:00:35 +02:00
2023-08-14 15:57:36 +00:00
2023-08-14 15:57:36 +00:00
2023-08-14 15:57:36 +00:00
2023-08-14 15:57:36 +00:00
2023-08-14 15:57:36 +00:00
2023-08-17 05:58:19 +00:00
2023-08-17 05:58:19 +00:00
2023-08-17 06:05:41 +00:00
2023-08-17 06:05:41 +00:00
2023-08-17 06:05:41 +00:00
2023-08-17 06:05:41 +00:00
2023-08-11 13:33:15 +00:00
2023-08-15 18:59:18 +00:00
2023-08-16 08:31:25 +05:30
2023-08-16 08:31:25 +05:30
2023-08-18 03:30:38 +00:00
2023-07-13 10:51:25 +00:00
2023-08-15 18:59:18 +00:00
2023-08-15 18:59:18 +00:00
2023-07-13 10:51:25 +00:00
2023-06-26 14:15:55 +02:00
2023-08-02 20:29:28 +00:00
2023-08-08 09:15:35 +00:00
2023-08-16 13:20:48 +00:00
2023-08-11 18:28:48 +00:00
2023-08-02 19:55:00 +00:00
2023-08-11 11:21:16 +00:00
2023-08-15 07:15:33 -04:00
2023-08-15 07:15:33 -04:00
2023-08-16 08:31:25 +05:30
2023-08-02 19:55:00 +00:00
2023-08-15 18:59:18 +00:00
2023-08-15 18:59:18 +00:00
2023-08-15 09:33:57 +02:00
2023-08-15 09:33:57 +02:00
2023-08-03 20:45:03 +00:00
2023-08-02 20:40:32 +00:00
2023-07-13 08:57:29 +02:00
2023-08-18 03:30:38 +00:00
2023-06-26 14:15:55 +02:00