Plugins/CheckerPlugins/CodeStyleChecker/NamingStyleChecker.py

branch
Py2 comp.
changeset 3058
0a02c433f52d
parent 3057
10516539f238
parent 3022
57179e4cdadd
child 3145
a9de05d4a22f
equal deleted inserted replaced
3057:10516539f238 3058:0a02c433f52d
29 Codes = [ 29 Codes = [
30 "N801", "N802", "N803", "N804", "N805", "N806", "N807", "N808", 30 "N801", "N802", "N803", "N804", "N805", "N806", "N807", "N808",
31 "N811", "N812", "N813", "N814", "N821", "N831" 31 "N811", "N812", "N813", "N814", "N821", "N831"
32 ] 32 ]
33 Messages = { 33 Messages = {
34 "N801": QT_TRANSLATE_NOOP("NamingStyleChecker", 34 "N801": QT_TRANSLATE_NOOP(
35 "NamingStyleChecker",
35 "class names should use CapWords convention"), 36 "class names should use CapWords convention"),
36 "N802": QT_TRANSLATE_NOOP("NamingStyleChecker", 37 "N802": QT_TRANSLATE_NOOP(
38 "NamingStyleChecker",
37 "function name should be lowercase"), 39 "function name should be lowercase"),
38 "N803": QT_TRANSLATE_NOOP("NamingStyleChecker", 40 "N803": QT_TRANSLATE_NOOP(
41 "NamingStyleChecker",
39 "argument name should be lowercase"), 42 "argument name should be lowercase"),
40 "N804": QT_TRANSLATE_NOOP("NamingStyleChecker", 43 "N804": QT_TRANSLATE_NOOP(
44 "NamingStyleChecker",
41 "first argument of a class method should be named 'cls'"), 45 "first argument of a class method should be named 'cls'"),
42 "N805": QT_TRANSLATE_NOOP("NamingStyleChecker", 46 "N805": QT_TRANSLATE_NOOP(
47 "NamingStyleChecker",
43 "first argument of a method should be named 'self'"), 48 "first argument of a method should be named 'self'"),
44 "N806": QT_TRANSLATE_NOOP("NamingStyleChecker", 49 "N806": QT_TRANSLATE_NOOP(
50 "NamingStyleChecker",
45 "first argument of a static method should not be named" 51 "first argument of a static method should not be named"
46 " 'self' or 'cls"), 52 " 'self' or 'cls"),
47 "N807": QT_TRANSLATE_NOOP("NamingStyleChecker", 53 "N807": QT_TRANSLATE_NOOP(
54 "NamingStyleChecker",
48 "module names should be lowercase"), 55 "module names should be lowercase"),
49 "N808": QT_TRANSLATE_NOOP("NamingStyleChecker", 56 "N808": QT_TRANSLATE_NOOP(
57 "NamingStyleChecker",
50 "package names should be lowercase"), 58 "package names should be lowercase"),
51 "N811": QT_TRANSLATE_NOOP("NamingStyleChecker", 59 "N811": QT_TRANSLATE_NOOP(
60 "NamingStyleChecker",
52 "constant imported as non constant"), 61 "constant imported as non constant"),
53 "N812": QT_TRANSLATE_NOOP("NamingStyleChecker", 62 "N812": QT_TRANSLATE_NOOP(
63 "NamingStyleChecker",
54 "lowercase imported as non lowercase"), 64 "lowercase imported as non lowercase"),
55 "N813": QT_TRANSLATE_NOOP("NamingStyleChecker", 65 "N813": QT_TRANSLATE_NOOP(
66 "NamingStyleChecker",
56 "camelcase imported as lowercase"), 67 "camelcase imported as lowercase"),
57 "N814": QT_TRANSLATE_NOOP("NamingStyleChecker", 68 "N814": QT_TRANSLATE_NOOP(
69 "NamingStyleChecker",
58 "camelcase imported as constant"), 70 "camelcase imported as constant"),
59 "N821": QT_TRANSLATE_NOOP("NamingStyleChecker", 71 "N821": QT_TRANSLATE_NOOP(
72 "NamingStyleChecker",
60 "variable in function should be lowercase"), 73 "variable in function should be lowercase"),
61 "N831": QT_TRANSLATE_NOOP("NamingStyleChecker", 74 "N831": QT_TRANSLATE_NOOP(
75 "NamingStyleChecker",
62 "names 'l', 'O' and 'I' should be avoided"), 76 "names 'l', 'O' and 'I' should be avoided"),
63 } 77 }
64 78
65 def __init__(self, tree, filename, options): 79 def __init__(self, tree, filename, options):
66 """ 80 """

eric ide

mercurial