---
source: crates/ruff_linter/src/rules/flake8_use_pathlib/mod.rs
snapshot_kind: text
---
PTH210.py:21:1: PTH210 Invalid suffix passed to `.with_suffix()`
   |
20 | ### Errors
21 | path.with_suffix(".")
   | ^^^^^^^^^^^^^^^^^^^^^ PTH210
22 | path.with_suffix("py")
23 | path.with_suffix(r"s")
   |
   = help: Remove "." or extend to valid suffix

PTH210.py:22:1: PTH210 [*] Dotless suffix passed to `.with_suffix()`
   |
20 | ### Errors
21 | path.with_suffix(".")
22 | path.with_suffix("py")
   | ^^^^^^^^^^^^^^^^^^^^^^ PTH210
23 | path.with_suffix(r"s")
24 | path.with_suffix(u'' "json")
   |
   = help: Add a leading dot

ℹ Unsafe fix
19 19 | 
20 20 | ### Errors
21 21 | path.with_suffix(".")
22    |-path.with_suffix("py")
   22 |+path.with_suffix(".py")
23 23 | path.with_suffix(r"s")
24 24 | path.with_suffix(u'' "json")
25 25 | path.with_suffix(suffix="js")

PTH210.py:23:1: PTH210 [*] Dotless suffix passed to `.with_suffix()`
   |
21 | path.with_suffix(".")
22 | path.with_suffix("py")
23 | path.with_suffix(r"s")
   | ^^^^^^^^^^^^^^^^^^^^^^ PTH210
24 | path.with_suffix(u'' "json")
25 | path.with_suffix(suffix="js")
   |
   = help: Add a leading dot

ℹ Unsafe fix
20 20 | ### Errors
21 21 | path.with_suffix(".")
22 22 | path.with_suffix("py")
23    |-path.with_suffix(r"s")
   23 |+path.with_suffix(r".s")
24 24 | path.with_suffix(u'' "json")
25 25 | path.with_suffix(suffix="js")
26 26 | 

PTH210.py:24:1: PTH210 [*] Dotless suffix passed to `.with_suffix()`
   |
22 | path.with_suffix("py")
23 | path.with_suffix(r"s")
24 | path.with_suffix(u'' "json")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
25 | path.with_suffix(suffix="js")
   |
   = help: Add a leading dot

ℹ Unsafe fix
21 21 | path.with_suffix(".")
22 22 | path.with_suffix("py")
23 23 | path.with_suffix(r"s")
24    |-path.with_suffix(u'' "json")
   24 |+path.with_suffix(u'.' "json")
25 25 | path.with_suffix(suffix="js")
26 26 | 
27 27 | posix_path.with_suffix(".")

PTH210.py:25:1: PTH210 [*] Dotless suffix passed to `.with_suffix()`
   |
23 | path.with_suffix(r"s")
24 | path.with_suffix(u'' "json")
25 | path.with_suffix(suffix="js")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
26 | 
27 | posix_path.with_suffix(".")
   |
   = help: Add a leading dot

ℹ Unsafe fix
22 22 | path.with_suffix("py")
23 23 | path.with_suffix(r"s")
24 24 | path.with_suffix(u'' "json")
25    |-path.with_suffix(suffix="js")
   25 |+path.with_suffix(suffix=".js")
26 26 | 
27 27 | posix_path.with_suffix(".")
28 28 | posix_path.with_suffix("py")

PTH210.py:27:1: PTH210 Invalid suffix passed to `.with_suffix()`
   |
25 | path.with_suffix(suffix="js")
26 | 
27 | posix_path.with_suffix(".")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
28 | posix_path.with_suffix("py")
29 | posix_path.with_suffix(r"s")
   |
   = help: Remove "." or extend to valid suffix

PTH210.py:28:1: PTH210 [*] Dotless suffix passed to `.with_suffix()`
   |
27 | posix_path.with_suffix(".")
28 | posix_path.with_suffix("py")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
29 | posix_path.with_suffix(r"s")
30 | posix_path.with_suffix(u'' "json")
   |
   = help: Add a leading dot

ℹ Unsafe fix
25 25 | path.with_suffix(suffix="js")
26 26 | 
27 27 | posix_path.with_suffix(".")
28    |-posix_path.with_suffix("py")
   28 |+posix_path.with_suffix(".py")
29 29 | posix_path.with_suffix(r"s")
30 30 | posix_path.with_suffix(u'' "json")
31 31 | posix_path.with_suffix(suffix="js")

PTH210.py:29:1: PTH210 [*] Dotless suffix passed to `.with_suffix()`
   |
27 | posix_path.with_suffix(".")
28 | posix_path.with_suffix("py")
29 | posix_path.with_suffix(r"s")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
30 | posix_path.with_suffix(u'' "json")
31 | posix_path.with_suffix(suffix="js")
   |
   = help: Add a leading dot

ℹ Unsafe fix
26 26 | 
27 27 | posix_path.with_suffix(".")
28 28 | posix_path.with_suffix("py")
29    |-posix_path.with_suffix(r"s")
   29 |+posix_path.with_suffix(r".s")
30 30 | posix_path.with_suffix(u'' "json")
31 31 | posix_path.with_suffix(suffix="js")
32 32 | 

PTH210.py:30:1: PTH210 [*] Dotless suffix passed to `.with_suffix()`
   |
28 | posix_path.with_suffix("py")
29 | posix_path.with_suffix(r"s")
30 | posix_path.with_suffix(u'' "json")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
31 | posix_path.with_suffix(suffix="js")
   |
   = help: Add a leading dot

ℹ Unsafe fix
27 27 | posix_path.with_suffix(".")
28 28 | posix_path.with_suffix("py")
29 29 | posix_path.with_suffix(r"s")
30    |-posix_path.with_suffix(u'' "json")
   30 |+posix_path.with_suffix(u'.' "json")
31 31 | posix_path.with_suffix(suffix="js")
32 32 | 
33 33 | pure_path.with_suffix(".")

PTH210.py:31:1: PTH210 [*] Dotless suffix passed to `.with_suffix()`
   |
29 | posix_path.with_suffix(r"s")
30 | posix_path.with_suffix(u'' "json")
31 | posix_path.with_suffix(suffix="js")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
32 | 
33 | pure_path.with_suffix(".")
   |
   = help: Add a leading dot

ℹ Unsafe fix
28 28 | posix_path.with_suffix("py")
29 29 | posix_path.with_suffix(r"s")
30 30 | posix_path.with_suffix(u'' "json")
31    |-posix_path.with_suffix(suffix="js")
   31 |+posix_path.with_suffix(suffix=".js")
32 32 | 
33 33 | pure_path.with_suffix(".")
34 34 | pure_path.with_suffix("py")

PTH210.py:33:1: PTH210 Invalid suffix passed to `.with_suffix()`
   |
31 | posix_path.with_suffix(suffix="js")
32 | 
33 | pure_path.with_suffix(".")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
34 | pure_path.with_suffix("py")
35 | pure_path.with_suffix(r"s")
   |
   = help: Remove "." or extend to valid suffix

PTH210.py:34:1: PTH210 [*] Dotless suffix passed to `.with_suffix()`
   |
33 | pure_path.with_suffix(".")
34 | pure_path.with_suffix("py")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
35 | pure_path.with_suffix(r"s")
36 | pure_path.with_suffix(u'' "json")
   |
   = help: Add a leading dot

ℹ Unsafe fix
31 31 | posix_path.with_suffix(suffix="js")
32 32 | 
33 33 | pure_path.with_suffix(".")
34    |-pure_path.with_suffix("py")
   34 |+pure_path.with_suffix(".py")
35 35 | pure_path.with_suffix(r"s")
36 36 | pure_path.with_suffix(u'' "json")
37 37 | pure_path.with_suffix(suffix="js")

PTH210.py:35:1: PTH210 [*] Dotless suffix passed to `.with_suffix()`
   |
33 | pure_path.with_suffix(".")
34 | pure_path.with_suffix("py")
35 | pure_path.with_suffix(r"s")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
36 | pure_path.with_suffix(u'' "json")
37 | pure_path.with_suffix(suffix="js")
   |
   = help: Add a leading dot

ℹ Unsafe fix
32 32 | 
33 33 | pure_path.with_suffix(".")
34 34 | pure_path.with_suffix("py")
35    |-pure_path.with_suffix(r"s")
   35 |+pure_path.with_suffix(r".s")
36 36 | pure_path.with_suffix(u'' "json")
37 37 | pure_path.with_suffix(suffix="js")
38 38 | 

PTH210.py:36:1: PTH210 [*] Dotless suffix passed to `.with_suffix()`
   |
34 | pure_path.with_suffix("py")
35 | pure_path.with_suffix(r"s")
36 | pure_path.with_suffix(u'' "json")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
37 | pure_path.with_suffix(suffix="js")
   |
   = help: Add a leading dot

ℹ Unsafe fix
33 33 | pure_path.with_suffix(".")
34 34 | pure_path.with_suffix("py")
35 35 | pure_path.with_suffix(r"s")
36    |-pure_path.with_suffix(u'' "json")
   36 |+pure_path.with_suffix(u'.' "json")
37 37 | pure_path.with_suffix(suffix="js")
38 38 | 
39 39 | pure_posix_path.with_suffix(".")

PTH210.py:37:1: PTH210 [*] Dotless suffix passed to `.with_suffix()`
   |
35 | pure_path.with_suffix(r"s")
36 | pure_path.with_suffix(u'' "json")
37 | pure_path.with_suffix(suffix="js")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
38 | 
39 | pure_posix_path.with_suffix(".")
   |
   = help: Add a leading dot

ℹ Unsafe fix
34 34 | pure_path.with_suffix("py")
35 35 | pure_path.with_suffix(r"s")
36 36 | pure_path.with_suffix(u'' "json")
37    |-pure_path.with_suffix(suffix="js")
   37 |+pure_path.with_suffix(suffix=".js")
38 38 | 
39 39 | pure_posix_path.with_suffix(".")
40 40 | pure_posix_path.with_suffix("py")

PTH210.py:39:1: PTH210 Invalid suffix passed to `.with_suffix()`
   |
37 | pure_path.with_suffix(suffix="js")
38 | 
39 | pure_posix_path.with_suffix(".")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
40 | pure_posix_path.with_suffix("py")
41 | pure_posix_path.with_suffix(r"s")
   |
   = help: Remove "." or extend to valid suffix

PTH210.py:40:1: PTH210 [*] Dotless suffix passed to `.with_suffix()`
   |
39 | pure_posix_path.with_suffix(".")
40 | pure_posix_path.with_suffix("py")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
41 | pure_posix_path.with_suffix(r"s")
42 | pure_posix_path.with_suffix(u'' "json")
   |
   = help: Add a leading dot

ℹ Unsafe fix
37 37 | pure_path.with_suffix(suffix="js")
38 38 | 
39 39 | pure_posix_path.with_suffix(".")
40    |-pure_posix_path.with_suffix("py")
   40 |+pure_posix_path.with_suffix(".py")
41 41 | pure_posix_path.with_suffix(r"s")
42 42 | pure_posix_path.with_suffix(u'' "json")
43 43 | pure_posix_path.with_suffix(suffix="js")

PTH210.py:41:1: PTH210 [*] Dotless suffix passed to `.with_suffix()`
   |
39 | pure_posix_path.with_suffix(".")
40 | pure_posix_path.with_suffix("py")
41 | pure_posix_path.with_suffix(r"s")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
42 | pure_posix_path.with_suffix(u'' "json")
43 | pure_posix_path.with_suffix(suffix="js")
   |
   = help: Add a leading dot

ℹ Unsafe fix
38 38 | 
39 39 | pure_posix_path.with_suffix(".")
40 40 | pure_posix_path.with_suffix("py")
41    |-pure_posix_path.with_suffix(r"s")
   41 |+pure_posix_path.with_suffix(r".s")
42 42 | pure_posix_path.with_suffix(u'' "json")
43 43 | pure_posix_path.with_suffix(suffix="js")
44 44 | 

PTH210.py:42:1: PTH210 [*] Dotless suffix passed to `.with_suffix()`
   |
40 | pure_posix_path.with_suffix("py")
41 | pure_posix_path.with_suffix(r"s")
42 | pure_posix_path.with_suffix(u'' "json")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
43 | pure_posix_path.with_suffix(suffix="js")
   |
   = help: Add a leading dot

ℹ Unsafe fix
39 39 | pure_posix_path.with_suffix(".")
40 40 | pure_posix_path.with_suffix("py")
41 41 | pure_posix_path.with_suffix(r"s")
42    |-pure_posix_path.with_suffix(u'' "json")
   42 |+pure_posix_path.with_suffix(u'.' "json")
43 43 | pure_posix_path.with_suffix(suffix="js")
44 44 | 
45 45 | pure_windows_path.with_suffix(".")

PTH210.py:43:1: PTH210 [*] Dotless suffix passed to `.with_suffix()`
   |
41 | pure_posix_path.with_suffix(r"s")
42 | pure_posix_path.with_suffix(u'' "json")
43 | pure_posix_path.with_suffix(suffix="js")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
44 | 
45 | pure_windows_path.with_suffix(".")
   |
   = help: Add a leading dot

ℹ Unsafe fix
40 40 | pure_posix_path.with_suffix("py")
41 41 | pure_posix_path.with_suffix(r"s")
42 42 | pure_posix_path.with_suffix(u'' "json")
43    |-pure_posix_path.with_suffix(suffix="js")
   43 |+pure_posix_path.with_suffix(suffix=".js")
44 44 | 
45 45 | pure_windows_path.with_suffix(".")
46 46 | pure_windows_path.with_suffix("py")

PTH210.py:45:1: PTH210 Invalid suffix passed to `.with_suffix()`
   |
43 | pure_posix_path.with_suffix(suffix="js")
44 | 
45 | pure_windows_path.with_suffix(".")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
46 | pure_windows_path.with_suffix("py")
47 | pure_windows_path.with_suffix(r"s")
   |
   = help: Remove "." or extend to valid suffix

PTH210.py:46:1: PTH210 [*] Dotless suffix passed to `.with_suffix()`
   |
45 | pure_windows_path.with_suffix(".")
46 | pure_windows_path.with_suffix("py")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
47 | pure_windows_path.with_suffix(r"s")
48 | pure_windows_path.with_suffix(u'' "json")
   |
   = help: Add a leading dot

ℹ Unsafe fix
43 43 | pure_posix_path.with_suffix(suffix="js")
44 44 | 
45 45 | pure_windows_path.with_suffix(".")
46    |-pure_windows_path.with_suffix("py")
   46 |+pure_windows_path.with_suffix(".py")
47 47 | pure_windows_path.with_suffix(r"s")
48 48 | pure_windows_path.with_suffix(u'' "json")
49 49 | pure_windows_path.with_suffix(suffix="js")

PTH210.py:47:1: PTH210 [*] Dotless suffix passed to `.with_suffix()`
   |
45 | pure_windows_path.with_suffix(".")
46 | pure_windows_path.with_suffix("py")
47 | pure_windows_path.with_suffix(r"s")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
48 | pure_windows_path.with_suffix(u'' "json")
49 | pure_windows_path.with_suffix(suffix="js")
   |
   = help: Add a leading dot

ℹ Unsafe fix
44 44 | 
45 45 | pure_windows_path.with_suffix(".")
46 46 | pure_windows_path.with_suffix("py")
47    |-pure_windows_path.with_suffix(r"s")
   47 |+pure_windows_path.with_suffix(r".s")
48 48 | pure_windows_path.with_suffix(u'' "json")
49 49 | pure_windows_path.with_suffix(suffix="js")
50 50 | 

PTH210.py:48:1: PTH210 [*] Dotless suffix passed to `.with_suffix()`
   |
46 | pure_windows_path.with_suffix("py")
47 | pure_windows_path.with_suffix(r"s")
48 | pure_windows_path.with_suffix(u'' "json")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
49 | pure_windows_path.with_suffix(suffix="js")
   |
   = help: Add a leading dot

ℹ Unsafe fix
45 45 | pure_windows_path.with_suffix(".")
46 46 | pure_windows_path.with_suffix("py")
47 47 | pure_windows_path.with_suffix(r"s")
48    |-pure_windows_path.with_suffix(u'' "json")
   48 |+pure_windows_path.with_suffix(u'.' "json")
49 49 | pure_windows_path.with_suffix(suffix="js")
50 50 | 
51 51 | windows_path.with_suffix(".")

PTH210.py:49:1: PTH210 [*] Dotless suffix passed to `.with_suffix()`
   |
47 | pure_windows_path.with_suffix(r"s")
48 | pure_windows_path.with_suffix(u'' "json")
49 | pure_windows_path.with_suffix(suffix="js")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
50 | 
51 | windows_path.with_suffix(".")
   |
   = help: Add a leading dot

ℹ Unsafe fix
46 46 | pure_windows_path.with_suffix("py")
47 47 | pure_windows_path.with_suffix(r"s")
48 48 | pure_windows_path.with_suffix(u'' "json")
49    |-pure_windows_path.with_suffix(suffix="js")
   49 |+pure_windows_path.with_suffix(suffix=".js")
50 50 | 
51 51 | windows_path.with_suffix(".")
52 52 | windows_path.with_suffix("py")

PTH210.py:51:1: PTH210 Invalid suffix passed to `.with_suffix()`
   |
49 | pure_windows_path.with_suffix(suffix="js")
50 | 
51 | windows_path.with_suffix(".")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
52 | windows_path.with_suffix("py")
53 | windows_path.with_suffix(r"s")
   |
   = help: Remove "." or extend to valid suffix

PTH210.py:52:1: PTH210 [*] Dotless suffix passed to `.with_suffix()`
   |
51 | windows_path.with_suffix(".")
52 | windows_path.with_suffix("py")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
53 | windows_path.with_suffix(r"s")
54 | windows_path.with_suffix(u'' "json")
   |
   = help: Add a leading dot

ℹ Unsafe fix
49 49 | pure_windows_path.with_suffix(suffix="js")
50 50 | 
51 51 | windows_path.with_suffix(".")
52    |-windows_path.with_suffix("py")
   52 |+windows_path.with_suffix(".py")
53 53 | windows_path.with_suffix(r"s")
54 54 | windows_path.with_suffix(u'' "json")
55 55 | windows_path.with_suffix(suffix="js")

PTH210.py:53:1: PTH210 [*] Dotless suffix passed to `.with_suffix()`
   |
51 | windows_path.with_suffix(".")
52 | windows_path.with_suffix("py")
53 | windows_path.with_suffix(r"s")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
54 | windows_path.with_suffix(u'' "json")
55 | windows_path.with_suffix(suffix="js")
   |
   = help: Add a leading dot

ℹ Unsafe fix
50 50 | 
51 51 | windows_path.with_suffix(".")
52 52 | windows_path.with_suffix("py")
53    |-windows_path.with_suffix(r"s")
   53 |+windows_path.with_suffix(r".s")
54 54 | windows_path.with_suffix(u'' "json")
55 55 | windows_path.with_suffix(suffix="js")
56 56 | 

PTH210.py:54:1: PTH210 [*] Dotless suffix passed to `.with_suffix()`
   |
52 | windows_path.with_suffix("py")
53 | windows_path.with_suffix(r"s")
54 | windows_path.with_suffix(u'' "json")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
55 | windows_path.with_suffix(suffix="js")
   |
   = help: Add a leading dot

ℹ Unsafe fix
51 51 | windows_path.with_suffix(".")
52 52 | windows_path.with_suffix("py")
53 53 | windows_path.with_suffix(r"s")
54    |-windows_path.with_suffix(u'' "json")
   54 |+windows_path.with_suffix(u'.' "json")
55 55 | windows_path.with_suffix(suffix="js")
56 56 | 
57 57 | 

PTH210.py:55:1: PTH210 [*] Dotless suffix passed to `.with_suffix()`
   |
53 | windows_path.with_suffix(r"s")
54 | windows_path.with_suffix(u'' "json")
55 | windows_path.with_suffix(suffix="js")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ PTH210
   |
   = help: Add a leading dot

ℹ Unsafe fix
52 52 | windows_path.with_suffix("py")
53 53 | windows_path.with_suffix(r"s")
54 54 | windows_path.with_suffix(u'' "json")
55    |-windows_path.with_suffix(suffix="js")
   55 |+windows_path.with_suffix(suffix=".js")
56 56 | 
57 57 | 
58 58 | ### No errors
