ruff/crates/ruff_linter/resources/test/fixtures/refurb/FURB167.py
Steve C 6183b8e98b
[refurb] Implement regex-flag-alias with fix (FURB167) (#9516)
## Summary

add
[`FURB167`/`use-long-regex-flag`](https://github.com/dosisod/refurb/blob/master/refurb/checks/regex/use_long_flag.py)
with autofix

See: #1348 

## Test Plan

`cargo test`

---------

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2024-01-14 23:40:17 +00:00

22 lines
322 B
Python

def func():
import re
# OK
if re.match("^hello", "hello world", re.IGNORECASE):
pass
def func():
import re
# FURB167
if re.match("^hello", "hello world", re.I):
pass
def func():
from re import match, I
# FURB167
if match("^hello", "hello world", I):
pass