FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
codeql/python/ql/src/Statements/DocStrings.qhelp at codeql-cli-2.19.2 · github/codeql · GitHub
github
/
codeql
Public
Notifications
You must be signed in to change notification settings
Fork
2.1k
Star
10.1k
Code
Issues
1k
Pull requests
470
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
codeql
/
python
/
ql
/
src
/
Statements
/
DocStrings.qhelp
Copy path
More file actions
More file actions
Latest commit
History
History
History
39 lines (28 loc) · 1.24 KB
Breadcrumbs
codeql
/
python
/
ql
/
src
/
Statements
/
DocStrings.qhelp
Copy path
File metadata and controls
39 lines (28 loc) · 1.24 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!
DOCTYPE
qhelp
PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<
qhelp
>
<
overview
>
<
p
>PEP8 mandates that all public modules, classes, functions and methods should have a documentation
string. Ensuring that every public module, class, function and method is documented makes it easier
for other developers to maintain the code.
</
p
>
</
overview
>
<
recommendation
>
<
p
>If a module, class, function or method needs to be public then add a documentation string that
describes the
purpose or use of the object (see PEP 257 for guidelines). If the object does not need to be public
then make it "private" by changing its name from <
code
>xxx</
code
> to <
code
>_xxx</
code
>.</
p
>
</
recommendation
>
<
example
>
<
p
>The following simple, public function should be updated to include a documentation string
immediately after the <
code
>def</
code
> line.</
p
>
<
sample
src
=
"
DocStrings.py
"
/>
<
p
>You might insert the documentation string: <
code
>"""Return the sum of x and y."""</
code
> on line 2.
</
p
></
example
>
<
references
>
<
li
>Python PEP 8: <
a
href
=
"
http://www.python.org/dev/peps/pep-0008/#documentation-strings
"
>Documentation strings</
a
>.</
li
>
<
li
>Python PEP 257: <
a
href
=
"
http://www.python.org/dev/peps/pep-0257
"
>Documentation string conventions
</
a
>.</
li
>
</
references
>
</
qhelp
>
Back
|
FazBrowse Home
|
New Git URL