eric6/Plugins/CheckerPlugins/CodeStyleChecker/DocStyle/translations.py

changeset 7784
3257703e10c5
child 7923
91e843545d9a
equal deleted inserted replaced
7783:36f66ce496bd 7784:3257703e10c5
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2020 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6
7 """
8 Module implementing message translations for the code style plugin messages
9 (code documentation part).
10 """
11
12 from PyQt5.QtCore import QCoreApplication
13
14 _docStyleMessages = {
15 "D101": QCoreApplication.translate(
16 "DocStyleChecker", "module is missing a docstring"),
17 "D102": QCoreApplication.translate(
18 "DocStyleChecker",
19 "public function/method is missing a docstring"),
20 "D103": QCoreApplication.translate(
21 "DocStyleChecker",
22 "private function/method may be missing a docstring"),
23 "D104": QCoreApplication.translate(
24 "DocStyleChecker", "public class is missing a docstring"),
25 "D105": QCoreApplication.translate(
26 "DocStyleChecker", "private class may be missing a docstring"),
27 "D111": QCoreApplication.translate(
28 "DocStyleChecker", 'docstring not surrounded by """'),
29 "D112": QCoreApplication.translate(
30 "DocStyleChecker",
31 'docstring containing \\ not surrounded by r"""'),
32 "D121": QCoreApplication.translate(
33 "DocStyleChecker", "one-liner docstring on multiple lines"),
34 "D122": QCoreApplication.translate(
35 "DocStyleChecker", "docstring has wrong indentation"),
36 "D130": QCoreApplication.translate(
37 "DocStyleChecker", "docstring does not contain a summary"),
38 "D131": QCoreApplication.translate(
39 "DocStyleChecker", "docstring summary does not end with a period"),
40 "D132": QCoreApplication.translate(
41 "DocStyleChecker",
42 "docstring summary is not in imperative mood"
43 " (Does instead of Do)"),
44 "D133": QCoreApplication.translate(
45 "DocStyleChecker",
46 "docstring summary looks like a function's/method's signature"),
47 "D134": QCoreApplication.translate(
48 "DocStyleChecker",
49 "docstring does not mention the return value type"),
50 "D141": QCoreApplication.translate(
51 "DocStyleChecker",
52 "function/method docstring is separated by a blank line"),
53 "D142": QCoreApplication.translate(
54 "DocStyleChecker",
55 "class docstring is not preceded by a blank line"),
56 "D143": QCoreApplication.translate(
57 "DocStyleChecker",
58 "class docstring is not followed by a blank line"),
59 "D144": QCoreApplication.translate(
60 "DocStyleChecker",
61 "docstring summary is not followed by a blank line"),
62 "D145": QCoreApplication.translate(
63 "DocStyleChecker",
64 "last paragraph of docstring is not followed by a blank line"),
65
66 "D201": QCoreApplication.translate(
67 "DocStyleChecker", "module docstring is still a default string"),
68 "D202": QCoreApplication.translate(
69 "DocStyleChecker", "function docstring is still a default string"),
70 "D203": QCoreApplication.translate(
71 "DocStyleChecker",
72 "private function/method is missing a docstring"),
73 "D205": QCoreApplication.translate(
74 "DocStyleChecker", "private class is missing a docstring"),
75 "D206": QCoreApplication.translate(
76 "DocStyleChecker", "class docstring is still a default string"),
77 "D221": QCoreApplication.translate(
78 "DocStyleChecker",
79 "leading quotes of docstring not on separate line"),
80 "D222": QCoreApplication.translate(
81 "DocStyleChecker",
82 "trailing quotes of docstring not on separate line"),
83 "D231": QCoreApplication.translate(
84 "DocStyleChecker", "docstring summary does not end with a period"),
85 "D232": QCoreApplication.translate(
86 "DocStyleChecker", "docstring summary does not start with '{0}'"),
87 "D234": QCoreApplication.translate(
88 "DocStyleChecker",
89 "docstring does not contain a @return line but function/method"
90 " returns something"),
91 "D235": QCoreApplication.translate(
92 "DocStyleChecker",
93 "docstring contains a @return line but function/method doesn't"
94 " return anything"),
95 "D236": QCoreApplication.translate(
96 "DocStyleChecker",
97 "docstring does not contain enough @param/@keyparam lines"),
98 "D237": QCoreApplication.translate(
99 "DocStyleChecker",
100 "docstring contains too many @param/@keyparam lines"),
101 "D238": QCoreApplication.translate(
102 "DocStyleChecker",
103 "keyword only arguments must be documented with @keyparam lines"),
104 "D239": QCoreApplication.translate(
105 "DocStyleChecker", "order of @param/@keyparam lines does"
106 " not match the function/method signature"),
107 "D242": QCoreApplication.translate(
108 "DocStyleChecker", "class docstring is preceded by a blank line"),
109 "D243": QCoreApplication.translate(
110 "DocStyleChecker", "class docstring is followed by a blank line"),
111 "D244": QCoreApplication.translate(
112 "DocStyleChecker",
113 "function/method docstring is preceded by a blank line"),
114 "D245": QCoreApplication.translate(
115 "DocStyleChecker",
116 "function/method docstring is followed by a blank line"),
117 "D246": QCoreApplication.translate(
118 "DocStyleChecker",
119 "docstring summary is not followed by a blank line"),
120 "D247": QCoreApplication.translate(
121 "DocStyleChecker",
122 "last paragraph of docstring is followed by a blank line"),
123 "D250": QCoreApplication.translate(
124 "DocStyleChecker",
125 "docstring does not contain a @exception line but function/method"
126 " raises an exception"),
127 "D251": QCoreApplication.translate(
128 "DocStyleChecker",
129 "docstring contains a @exception line but function/method doesn't"
130 " raise an exception"),
131 "D252": QCoreApplication.translate(
132 "DocStyleChecker",
133 "raised exception '{0}' is not documented in docstring"),
134 "D253": QCoreApplication.translate(
135 "DocStyleChecker",
136 "documented exception '{0}' is not raised"),
137 "D260": QCoreApplication.translate(
138 "DocStyleChecker",
139 "docstring does not contain a @signal line but class defines signals"),
140 "D261": QCoreApplication.translate(
141 "DocStyleChecker",
142 "docstring contains a @signal line but class doesn't define signals"),
143 "D262": QCoreApplication.translate(
144 "DocStyleChecker",
145 "defined signal '{0}' is not documented in docstring"),
146 "D263": QCoreApplication.translate(
147 "DocStyleChecker",
148 "documented signal '{0}' is not defined"),
149
150 "D901": QCoreApplication.translate(
151 "DocStyleChecker", "{0}: {1}"),
152 }
153
154 _docStyleMessagesSampleArgs = {
155 "D232": ["public"],
156 "D252": ["RuntimeError"],
157 "D253": ["RuntimeError"],
158 "D262": ["buttonClicked"],
159 "D263": ["buttonClicked"],
160 "D901": ["SyntaxError", "Invalid Syntax"],
161 }

eric ide

mercurial