---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
---
B034.py:5:1: B034 `re.sub` should pass `count` and `flags` as keyword arguments to avoid confusion due to unintuitive argument positions
  |
4 | # B034
5 | re.sub("a", "b", "aaa", re.IGNORECASE)
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ B034
6 | re.sub("a", "b", "aaa", 5)
7 | re.sub("a", "b", "aaa", 5, re.IGNORECASE)
  |

B034.py:6:1: B034 `re.sub` should pass `count` and `flags` as keyword arguments to avoid confusion due to unintuitive argument positions
  |
4 | # B034
5 | re.sub("a", "b", "aaa", re.IGNORECASE)
6 | re.sub("a", "b", "aaa", 5)
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^ B034
7 | re.sub("a", "b", "aaa", 5, re.IGNORECASE)
8 | re.subn("a", "b", "aaa", re.IGNORECASE)
  |

B034.py:7:1: B034 `re.sub` should pass `count` and `flags` as keyword arguments to avoid confusion due to unintuitive argument positions
  |
5 | re.sub("a", "b", "aaa", re.IGNORECASE)
6 | re.sub("a", "b", "aaa", 5)
7 | re.sub("a", "b", "aaa", 5, re.IGNORECASE)
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ B034
8 | re.subn("a", "b", "aaa", re.IGNORECASE)
9 | re.subn("a", "b", "aaa", 5)
  |

B034.py:8:1: B034 `re.subn` should pass `count` and `flags` as keyword arguments to avoid confusion due to unintuitive argument positions
   |
 6 | re.sub("a", "b", "aaa", 5)
 7 | re.sub("a", "b", "aaa", 5, re.IGNORECASE)
 8 | re.subn("a", "b", "aaa", re.IGNORECASE)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ B034
 9 | re.subn("a", "b", "aaa", 5)
10 | re.subn("a", "b", "aaa", 5, re.IGNORECASE)
   |

B034.py:9:1: B034 `re.subn` should pass `count` and `flags` as keyword arguments to avoid confusion due to unintuitive argument positions
   |
 7 | re.sub("a", "b", "aaa", 5, re.IGNORECASE)
 8 | re.subn("a", "b", "aaa", re.IGNORECASE)
 9 | re.subn("a", "b", "aaa", 5)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ B034
10 | re.subn("a", "b", "aaa", 5, re.IGNORECASE)
11 | re.split(" ", "a a a a", re.I)
   |

B034.py:10:1: B034 `re.subn` should pass `count` and `flags` as keyword arguments to avoid confusion due to unintuitive argument positions
   |
 8 | re.subn("a", "b", "aaa", re.IGNORECASE)
 9 | re.subn("a", "b", "aaa", 5)
10 | re.subn("a", "b", "aaa", 5, re.IGNORECASE)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ B034
11 | re.split(" ", "a a a a", re.I)
12 | re.split(" ", "a a a a", 2)
   |

B034.py:11:1: B034 `re.split` should pass `maxsplit` and `flags` as keyword arguments to avoid confusion due to unintuitive argument positions
   |
 9 | re.subn("a", "b", "aaa", 5)
10 | re.subn("a", "b", "aaa", 5, re.IGNORECASE)
11 | re.split(" ", "a a a a", re.I)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ B034
12 | re.split(" ", "a a a a", 2)
13 | re.split(" ", "a a a a", 2, re.I)
   |

B034.py:12:1: B034 `re.split` should pass `maxsplit` and `flags` as keyword arguments to avoid confusion due to unintuitive argument positions
   |
10 | re.subn("a", "b", "aaa", 5, re.IGNORECASE)
11 | re.split(" ", "a a a a", re.I)
12 | re.split(" ", "a a a a", 2)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ B034
13 | re.split(" ", "a a a a", 2, re.I)
14 | sub("a", "b", "aaa", re.IGNORECASE)
   |

B034.py:13:1: B034 `re.split` should pass `maxsplit` and `flags` as keyword arguments to avoid confusion due to unintuitive argument positions
   |
11 | re.split(" ", "a a a a", re.I)
12 | re.split(" ", "a a a a", 2)
13 | re.split(" ", "a a a a", 2, re.I)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ B034
14 | sub("a", "b", "aaa", re.IGNORECASE)
   |

B034.py:14:1: B034 `re.sub` should pass `count` and `flags` as keyword arguments to avoid confusion due to unintuitive argument positions
   |
12 | re.split(" ", "a a a a", 2)
13 | re.split(" ", "a a a a", 2, re.I)
14 | sub("a", "b", "aaa", re.IGNORECASE)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ B034
15 | 
16 | # OK
   |


