mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 06:11:43 +00:00

## Summary Resolves #13294, follow-up to #13882. At #13882, it was concluded that a fix should not be offered for raw strings. This change implements that. The five rules in question are now no longer always fixable. ## Test Plan `cargo nextest run` and `cargo insta test`. --------- Co-authored-by: Micha Reiser <micha@reiser.io>
1.7 KiB
1.7 KiB
# ensures language of the file is detected as English in text editors
# (Pylint, "E1206") => Rule::LoggingTooFewArgs,
# (Pylint, "E1307") => Rule::BadStringFormatType,
# (Pylint, "E2502") => Rule::BidirectionalUnicode,
# (Pylint, "E2510") => Rule::InvalidCharacterBackspace,
# (Pylint, "E2511") => Rule::InvalidCharacterCarriageReturn,
# (Pylint, "E2512") => Rule::InvalidCharacterSub,
# (Pylint, "E2513") => Rule::InvalidCharacterEsc,
# (Pylint, "E2514") => Rule::InvalidCharacterNul,
# (Pylint, "E2515") => Rule::InvalidCharacterZeroWidthSpace,
# (Pylint, "E1310") => Rule::BadStrStripCall,
# (Pylint, "C0414") => Rule::UselessImportAlias,
# (Pylint, "C3002") => Rule::UnnecessaryDirectLambdaCall,
#foo = 'hi'
b = '
b = f'
b_ok = '\\b'
b_ok = f'\\b'
cr_ok = '\\r'
cr_ok = f'\\r'
sub = 'sub '
sub = f'sub '
sub_ok = '\x1a'
sub_ok = f'\x1a'
esc = 'esc esc '
esc = f'esc esc '
esc_ok = '\x1b'
esc_ok = f'\x1b'
nul = '''
nul
# (Pylint, "E1206") => Rule::LoggingTooFewArgs,
# (Pylint, "E1307") => Rule::BadStringFormatType,
# (Pylint, "E2502") => Rule::BidirectionalUnicode,
# (Pylint, "E2510") => Rule::InvalidCharacterBackspace,
# (Pylint, "E2511") => Rule::InvalidCharacterCarriageReturn,
# (Pylint, "E2512") => Rule::InvalidCharacterSub,
# (Pylint, "E2513") => Rule::InvalidCharacterEsc,
# (Pylint, "E2514") => Rule::InvalidCharacterNul,
# (Pylint, "E2515") => Rule::InvalidCharacterZeroWidthSpace,
# (Pylint, "E1310") => Rule::BadStrStripCall,
# (Pylint, "C0414") => Rule::UselessImportAlias,
# (Pylint, "C3002") => Rule::UnnecessaryDirectLambdaCall,
#foo = 'hi'
b = '
b = f'
b_ok = '\\b'
b_ok = f'\\b'
cr_ok = '\\r'
cr_ok = f'\\r'
sub = 'sub '
sub = f'sub '
sub_ok = '\x1a'
sub_ok = f'\x1a'
esc = 'esc esc '
esc = f'esc esc '
esc_ok = '\x1b'
esc_ok = f'\x1b'
nul = '''
nul