Plugins/CheckerPlugins/CodeStyleChecker/NamingStyleChecker.py

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

eric ide

mercurial