19 "P102": QCoreApplication.translate( |
19 "P102": QCoreApplication.translate( |
20 "PathlibChecker", "os.mkdir('foo') should be replaced by foo_path.mkdir()" |
20 "PathlibChecker", "os.mkdir('foo') should be replaced by foo_path.mkdir()" |
21 ), |
21 ), |
22 "P103": QCoreApplication.translate( |
22 "P103": QCoreApplication.translate( |
23 "PathlibChecker", |
23 "PathlibChecker", |
24 "os.makedirs('foo/bar') should be replaced by " "bar_path.mkdir(parents=True)", |
24 "os.makedirs('foo/bar') should be replaced by bar_path.mkdir(parents=True)", |
25 ), |
25 ), |
26 "P104": QCoreApplication.translate( |
26 "P104": QCoreApplication.translate( |
27 "PathlibChecker", |
27 "PathlibChecker", |
28 "os.rename('foo', 'bar') should be replaced by " "foo_path.rename(Path('bar'))", |
28 "os.rename('foo', 'bar') should be replaced by foo_path.rename(Path('bar'))", |
29 ), |
29 ), |
30 "P105": QCoreApplication.translate( |
30 "P105": QCoreApplication.translate( |
31 "PathlibChecker", |
31 "PathlibChecker", |
32 "os.replace('foo', 'bar') should be replaced by " |
32 "os.replace('foo', 'bar') should be replaced by " |
33 "foo_path.replace(Path('bar'))", |
33 "foo_path.replace(Path('bar'))", |
56 "PathlibChecker", |
56 "PathlibChecker", |
57 "os.listdir(path='foo') should be replaced by foo_path.iterdir()", |
57 "os.listdir(path='foo') should be replaced by foo_path.iterdir()", |
58 ), |
58 ), |
59 "P113": QCoreApplication.translate( |
59 "P113": QCoreApplication.translate( |
60 "PathlibChecker", |
60 "PathlibChecker", |
61 "os.link('bar', 'foo') should be replaced by" " foo_path.hardlink_to('bar')", |
61 "os.link('bar', 'foo') should be replaced by foo_path.hardlink_to('bar')", |
62 ), |
62 ), |
63 "P114": QCoreApplication.translate( |
63 "P114": QCoreApplication.translate( |
64 "PathlibChecker", |
64 "PathlibChecker", |
65 "os.symlink('bar', 'foo') should be replaced by" " foo_path.symlink_to('bar')", |
65 "os.symlink('bar', 'foo') should be replaced by foo_path.symlink_to('bar')", |
66 ), |
66 ), |
67 "P201": QCoreApplication.translate( |
67 "P201": QCoreApplication.translate( |
68 "PathlibChecker", |
68 "PathlibChecker", |
69 "os.path.abspath('foo') should be replaced by foo_path.resolve()", |
69 "os.path.abspath('foo') should be replaced by foo_path.resolve()", |
70 ), |
70 ), |
72 "PathlibChecker", |
72 "PathlibChecker", |
73 "os.path.exists('foo') should be replaced by foo_path.exists()", |
73 "os.path.exists('foo') should be replaced by foo_path.exists()", |
74 ), |
74 ), |
75 "P203": QCoreApplication.translate( |
75 "P203": QCoreApplication.translate( |
76 "PathlibChecker", |
76 "PathlibChecker", |
77 "os.path.expanduser('~/foo') should be replaced by " "foo_path.expanduser()", |
77 "os.path.expanduser('~/foo') should be replaced by foo_path.expanduser()", |
78 ), |
78 ), |
79 "P204": QCoreApplication.translate( |
79 "P204": QCoreApplication.translate( |
80 "PathlibChecker", "os.path.isdir('foo') should be replaced by foo_path.is_dir()" |
80 "PathlibChecker", "os.path.isdir('foo') should be replaced by foo_path.is_dir()" |
81 ), |
81 ), |
82 "P205": QCoreApplication.translate( |
82 "P205": QCoreApplication.translate( |
91 "PathlibChecker", |
91 "PathlibChecker", |
92 "os.path.isabs('foo') should be replaced by foo_path.is_absolute()", |
92 "os.path.isabs('foo') should be replaced by foo_path.is_absolute()", |
93 ), |
93 ), |
94 "P208": QCoreApplication.translate( |
94 "P208": QCoreApplication.translate( |
95 "PathlibChecker", |
95 "PathlibChecker", |
96 "os.path.join('foo', 'bar') should be replaced by " "foo_path / 'bar'", |
96 "os.path.join('foo', 'bar') should be replaced by foo_path / 'bar'", |
97 ), |
97 ), |
98 "P209": QCoreApplication.translate( |
98 "P209": QCoreApplication.translate( |
99 "PathlibChecker", |
99 "PathlibChecker", |
100 "os.path.basename('foo/bar') should be replaced by bar_path.name", |
100 "os.path.basename('foo/bar') should be replaced by bar_path.name", |
101 ), |
101 ), |