10 |
10 |
11 from PyQt6.QtCore import QCoreApplication |
11 from PyQt6.QtCore import QCoreApplication |
12 |
12 |
13 _importsMessages = { |
13 _importsMessages = { |
14 "I101": QCoreApplication.translate( |
14 "I101": QCoreApplication.translate( |
15 "ImportsChecker", |
15 "ImportsChecker", "local import must be at the beginning of the method body" |
16 "local import must be at the beginning of the method body"), |
16 ), |
17 "I102": QCoreApplication.translate( |
17 "I102": QCoreApplication.translate( |
18 "ImportsChecker", |
18 "ImportsChecker", |
19 "packages from external modules should not be imported locally"), |
19 "packages from external modules should not be imported locally", |
|
20 ), |
20 "I103": QCoreApplication.translate( |
21 "I103": QCoreApplication.translate( |
21 "ImportsChecker", |
22 "ImportsChecker", |
22 "packages from standard modules should not be imported locally"), |
23 "packages from standard modules should not be imported locally", |
23 |
24 ), |
24 "I201": QCoreApplication.translate( |
25 "I201": QCoreApplication.translate( |
25 "ImportsChecker", |
26 "ImportsChecker", |
26 "Import statements are in the wrong order. " |
27 "Import statements are in the wrong order. " "'{0}' should be before '{1}'", |
27 "'{0}' should be before '{1}'"), |
28 ), |
28 "I202": QCoreApplication.translate( |
29 "I202": QCoreApplication.translate( |
29 "ImportsChecker", |
30 "ImportsChecker", "Imported names are in the wrong order. " "Should be '{0}'" |
30 "Imported names are in the wrong order. " |
31 ), |
31 "Should be '{0}'"), |
|
32 "I203": QCoreApplication.translate( |
32 "I203": QCoreApplication.translate( |
33 "ImportsChecker", |
33 "ImportsChecker", |
34 "Import statements should be combined. " |
34 "Import statements should be combined. " "'{0}' should be combined with '{1}'", |
35 "'{0}' should be combined with '{1}'"), |
35 ), |
36 "I204": QCoreApplication.translate( |
36 "I204": QCoreApplication.translate( |
37 "ImportsChecker", |
37 "ImportsChecker", |
38 "The names in __all__ are in the wrong order. " |
38 "The names in __all__ are in the wrong order. " "The order should be '{0}'", |
39 "The order should be '{0}'"), |
39 ), |
40 |
|
41 "I901": QCoreApplication.translate( |
40 "I901": QCoreApplication.translate( |
42 "ImportsChecker", |
41 "ImportsChecker", "unnecessary import alias - rewrite as '{0}'" |
43 "unnecessary import alias - rewrite as '{0}'"), |
42 ), |
44 "I902": QCoreApplication.translate( |
43 "I902": QCoreApplication.translate("ImportsChecker", "banned import '{0}' used"), |
45 "ImportsChecker", |
|
46 "banned import '{0}' used"), |
|
47 "I903": QCoreApplication.translate( |
44 "I903": QCoreApplication.translate( |
48 "ImportsChecker", |
45 "ImportsChecker", "relative imports from parent modules are banned" |
49 "relative imports from parent modules are banned"), |
46 ), |
50 "I904": QCoreApplication.translate( |
47 "I904": QCoreApplication.translate("ImportsChecker", "relative imports are banned"), |
51 "ImportsChecker", |
|
52 "relative imports are banned"), |
|
53 } |
48 } |
54 |
49 |
55 _importsMessagesSampleArgs = { |
50 _importsMessagesSampleArgs = { |
56 "I201": ["import bar", "import foo"], |
51 "I201": ["import bar", "import foo"], |
57 "I202": ["bar, baz, foo"], |
52 "I202": ["bar, baz, foo"], |