mirror of https://github.com/astral-sh/ruff
[flake8-commas]: Fix example replacement in docs (#14843)
## Summary
Minor change for the documentation of COM818 rule. This was a block
called “In the event that a tuple is intended”, but the suggested change
did not produce a tuple.
## Test Plan
```python
>>> import json
>>> (json.dumps({"bar": 1}),) # this is a tuple
('{"bar": 1}',)
>>> (json.dumps({"bar": 1})) # not a tuple
'{"bar": 1}'
```
This commit is contained in:
parent
ed6de39725
commit
d53e5cd25a
|
|
@ -188,7 +188,7 @@ impl AlwaysFixableViolation for MissingTrailingComma {
|
|||
/// import json
|
||||
///
|
||||
///
|
||||
/// foo = (json.dumps({"bar": 1}))
|
||||
/// foo = (json.dumps({"bar": 1}),)
|
||||
/// ```
|
||||
#[derive(ViolationMetadata)]
|
||||
pub(crate) struct TrailingCommaOnBareTuple;
|
||||
|
|
|
|||
Loading…
Reference in New Issue