Closed dragon-dxw closed 1 year ago
@dragon-dxw the fixed version is in fact valid syntax in Python 3.12. If you set the target Python version to 3.11 or lower in your configuration using target-version
, this should no longer be marked as an error. See https://github.com/astral-sh/ruff/pull/7588
Yeah, in my testing this seems to be correctly detected based on the Python version. Do you mind testing if your Python version is set to Python 3.12? Happy to revisit if we're able to reproduce with a lower target-version.
Version: 0.1.5 input:
msg = f"Document \"{context['document'].name}\" does not have a PDF."
error [no args, invoked by precommit]:judgments/views/document_full_text.py:38:19: Q003 [*] Change outer quotes to avoid escaping inner quotes
autofix via--fix
[via precommit]msg = f'Document "{context['document'].name}" does not have a PDF.'
which is not valid pythonruff config: https://github.com/nationalarchives/ds-caselaw-editor-ui/blob/chore/test-factory-improvements/pyproject.toml