---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
---
B034 `re.sub` should pass `count` and `flags` as keyword arguments to avoid confusion due to unintuitive argument positions
 --> B034.py:5:1
  |
4 | # B034
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 `re.sub` should pass `count` and `flags` as keyword arguments to avoid confusion due to unintuitive argument positions
 --> B034.py:6:1
  |
4 | # B034
5 | re.sub("a", "b", "aaa", re.IGNORECASE)
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 `re.sub` should pass `count` and `flags` as keyword arguments to avoid confusion due to unintuitive argument positions
 --> B034.py:7:1
  |
5 | re.sub("a", "b", "aaa", re.IGNORECASE)
6 | re.sub("a", "b", "aaa", 5)
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 `re.subn` should pass `count` and `flags` as keyword arguments to avoid confusion due to unintuitive argument positions
  --> B034.py:8:1
   |
 6 | re.sub("a", "b", "aaa", 5)
 7 | re.sub("a", "b", "aaa", 5, re.IGNORECASE)
 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 `re.subn` should pass `count` and `flags` as keyword arguments to avoid confusion due to unintuitive argument positions
  --> B034.py:9:1
   |
 7 | re.sub("a", "b", "aaa", 5, re.IGNORECASE)
 8 | re.subn("a", "b", "aaa", re.IGNORECASE)
 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 `re.subn` should pass `count` and `flags` as keyword arguments to avoid confusion due to unintuitive argument positions
  --> B034.py:10:1
   |
 8 | re.subn("a", "b", "aaa", re.IGNORECASE)
 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)
12 | re.split(" ", "a a a a", 2)
   |

B034 `re.split` should pass `maxsplit` and `flags` as keyword arguments to avoid confusion due to unintuitive argument positions
  --> B034.py:11:1
   |
 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)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12 | re.split(" ", "a a a a", 2)
13 | re.split(" ", "a a a a", 2, re.I)
   |

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

B034 `re.split` should pass `maxsplit` and `flags` as keyword arguments to avoid confusion due to unintuitive argument positions
  --> B034.py:13:1
   |
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)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14 | sub("a", "b", "aaa", re.IGNORECASE)
   |

B034 `re.sub` should pass `count` and `flags` as keyword arguments to avoid confusion due to unintuitive argument positions
  --> B034.py:14:1
   |
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)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15 |
16 | # OK
   |
