PEP8 conformance for comment verifier module

This commit is contained in:
William S Fulton 2018-05-24 19:28:15 +01:00
commit 95caf87596
11 changed files with 67 additions and 67 deletions

View file

@ -1,5 +1,5 @@
from autodoc import *
import commentVerifier
import comment_verifier
import inspect
import sys
@ -8,7 +8,7 @@ def check(got, expected, expected_builtin=None, skip=False):
expect = expected
if is_python_builtin() and expected_builtin != None:
expect = expected_builtin
commentVerifier.check(got, expect)
comment_verifier.check(got, expect)
def is_new_style_class(cls):
return hasattr(cls, "__class__")

View file

@ -2,9 +2,9 @@
import doxygen_alias
import inspect
import commentVerifier
import comment_verifier
commentVerifier.check(inspect.getdoc(doxygen_alias.make_something),
comment_verifier.check(inspect.getdoc(doxygen_alias.make_something),
"""\
A function returning something.

View file

@ -4,9 +4,9 @@ import doxygen_basic_notranslate
import inspect
import string
import sys
import commentVerifier
import comment_verifier
commentVerifier.check(inspect.getdoc(doxygen_basic_notranslate.function),
comment_verifier.check(inspect.getdoc(doxygen_basic_notranslate.function),
r"""\brief
Brief description.
@ -16,12 +16,12 @@ The comment text
\sa function2"""
)
commentVerifier.check(inspect.getdoc(doxygen_basic_notranslate.function2),
comment_verifier.check(inspect.getdoc(doxygen_basic_notranslate.function2),
r"""A test of a very very very very very very very very very very very very very very very very
very very very very very long comment string."""
)
commentVerifier.check(inspect.getdoc(doxygen_basic_notranslate.function3),
comment_verifier.check(inspect.getdoc(doxygen_basic_notranslate.function3),
r"""*Overload 1:*
A test for overloaded functions
@ -35,7 +35,7 @@ A test for overloaded functions
This is function \b two"""
)
commentVerifier.check(inspect.getdoc(doxygen_basic_notranslate.function4),
comment_verifier.check(inspect.getdoc(doxygen_basic_notranslate.function4),
r"""A test of some mixed tag usage
\if CONDITION
This \a code fragment shows us something \.
@ -51,14 +51,14 @@ int main() { while(true); }
\endcode
\endif"""
)
commentVerifier.check(inspect.getdoc(doxygen_basic_notranslate.function5),
comment_verifier.check(inspect.getdoc(doxygen_basic_notranslate.function5),
r"""This is a post comment. """
)
commentVerifier.check(inspect.getdoc(doxygen_basic_notranslate.function6),
comment_verifier.check(inspect.getdoc(doxygen_basic_notranslate.function6),
r"""Test for default args
@param a Some parameter, default is 42"""
)
commentVerifier.check(inspect.getdoc(doxygen_basic_notranslate.function7),
comment_verifier.check(inspect.getdoc(doxygen_basic_notranslate.function7),
r"""Test for a parameter with difficult type
(mostly for python)
@param a Very strange param"""

View file

@ -4,9 +4,9 @@ import doxygen_basic_translate
import inspect
import string
import sys
import commentVerifier
import comment_verifier
commentVerifier.check(inspect.getdoc(doxygen_basic_translate.function),
comment_verifier.check(inspect.getdoc(doxygen_basic_translate.function),
"""\
Brief description.
@ -19,12 +19,12 @@ Author: Some author
See also: function2"""
)
commentVerifier.check(inspect.getdoc(doxygen_basic_translate.function2),
comment_verifier.check(inspect.getdoc(doxygen_basic_translate.function2),
"""\
A test of a very very very very very very very very very very very very very very very very
very very very very very long comment string."""
)
commentVerifier.check(inspect.getdoc(doxygen_basic_translate.function3),
comment_verifier.check(inspect.getdoc(doxygen_basic_translate.function3),
"""*Overload 1:*
A test for overloaded functions
@ -37,7 +37,7 @@ This is function **one**
A test for overloaded functions
This is function **two**"""
)
commentVerifier.check(inspect.getdoc(doxygen_basic_translate.function4),
comment_verifier.check(inspect.getdoc(doxygen_basic_translate.function4),
"""\
A test of some mixed tag usage
If: CONDITION {
@ -56,16 +56,16 @@ Warning: This may not work as expected
}"""
)
commentVerifier.check(inspect.getdoc(doxygen_basic_translate.function5),
comment_verifier.check(inspect.getdoc(doxygen_basic_translate.function5),
"""This is a post comment."""
)
commentVerifier.check(inspect.getdoc(doxygen_basic_translate.function6),
comment_verifier.check(inspect.getdoc(doxygen_basic_translate.function6),
"""\
Test for default args
:type a: int
:param a: Some parameter, default is 42"""
)
commentVerifier.check(inspect.getdoc(doxygen_basic_translate.function7),
comment_verifier.check(inspect.getdoc(doxygen_basic_translate.function7),
"""\
Test for a parameter with difficult type
(mostly for python)
@ -73,7 +73,7 @@ Test for a parameter with difficult type
:param a: Very strange param"""
)
commentVerifier.check(inspect.getdoc(doxygen_basic_translate.Atan2),
comment_verifier.check(inspect.getdoc(doxygen_basic_translate.Atan2),
"""\
Multiple parameters test.

View file

@ -2,9 +2,9 @@
import doxygen_ignore
import inspect
import commentVerifier
import comment_verifier
commentVerifier.check(inspect.getdoc(doxygen_ignore.func),
comment_verifier.check(inspect.getdoc(doxygen_ignore.func),
"""\
A contrived example of ignoring too many commands in one comment.

View file

@ -4,10 +4,10 @@ import doxygen_misc_constructs
import inspect
import string
import sys
import commentVerifier
import comment_verifier
commentVerifier.check(inspect.getdoc(doxygen_misc_constructs.getAddress),
comment_verifier.check(inspect.getdoc(doxygen_misc_constructs.getAddress),
r"""Returns address of file line.
:type fileName: int
@ -19,7 +19,7 @@ commentVerifier.check(inspect.getdoc(doxygen_misc_constructs.getAddress),
Connection::getId() """)
commentVerifier.check(inspect.getdoc(doxygen_misc_constructs.CConnectionConfig),
comment_verifier.check(inspect.getdoc(doxygen_misc_constructs.CConnectionConfig),
r"""This class contains information for connection to winIDEA. Its methods
return reference to self, so we can use it like this:
@ -34,26 +34,26 @@ used for unspecified parameters.
advancedWinIDEALaunching.py Python example.""")
commentVerifier.check(inspect.getdoc(doxygen_misc_constructs.waitTime),
comment_verifier.check(inspect.getdoc(doxygen_misc_constructs.waitTime),
r"""Determines how long the ``isystem.connect`` should wait for running
instances to respond. Only one of ``lfWaitXXX`` flags from IConnect::ELaunchFlags
may be specified."""
)
commentVerifier.check(inspect.getdoc(doxygen_misc_constructs.getConnection),
comment_verifier.check(inspect.getdoc(doxygen_misc_constructs.getConnection),
r"""This function returns connection id."""
)
commentVerifier.check(inspect.getdoc(doxygen_misc_constructs.getFirstLetter),
comment_verifier.check(inspect.getdoc(doxygen_misc_constructs.getFirstLetter),
r''
)
commentVerifier.check(inspect.getdoc(doxygen_misc_constructs.ClassWithNestedEnum),
comment_verifier.check(inspect.getdoc(doxygen_misc_constructs.ClassWithNestedEnum),
r"""Class description."""
)
commentVerifier.check(inspect.getdoc(doxygen_misc_constructs.showList),
comment_verifier.check(inspect.getdoc(doxygen_misc_constructs.showList),
r"""An example of a list in a documentation comment.
- The first item of the list.
@ -66,24 +66,24 @@ commentVerifier.check(inspect.getdoc(doxygen_misc_constructs.showList),
And this is not a list item any more."""
)
commentVerifier.check(inspect.getdoc(doxygen_misc_constructs.isNoSpaceValidA),
comment_verifier.check(inspect.getdoc(doxygen_misc_constructs.isNoSpaceValidA),
r"""This comment without space after '*' is valid in Doxygen."""
)
commentVerifier.check(inspect.getdoc(doxygen_misc_constructs.isNoSpaceValidB),
comment_verifier.check(inspect.getdoc(doxygen_misc_constructs.isNoSpaceValidB),
r""".This comment without space after '*' is valid in Doxygen."""
)
commentVerifier.check(inspect.getdoc(doxygen_misc_constructs.isNoSpaceValidC),
comment_verifier.check(inspect.getdoc(doxygen_misc_constructs.isNoSpaceValidC),
r''
)
commentVerifier.check(inspect.getdoc(doxygen_misc_constructs.backslashA),
comment_verifier.check(inspect.getdoc(doxygen_misc_constructs.backslashA),
r"""Backslash following``word`` is a valid doxygen command. Output contains
'followingword' with 'word' in code font."""
)
commentVerifier.check(inspect.getdoc(doxygen_misc_constructs.backslashB),
comment_verifier.check(inspect.getdoc(doxygen_misc_constructs.backslashB),
r"""Doxy command without trailing space is ignored - nothing appears
on output. Standalone \ and '\' get to output.
Standalone @ and '@' get to output.
@ -98,7 +98,7 @@ Commands for escaped symbols:
$ @ \ & ~ < > # % " . :: @text ::text"""
)
commentVerifier.check(inspect.getdoc(doxygen_misc_constructs.backslashC),
comment_verifier.check(inspect.getdoc(doxygen_misc_constructs.backslashC),
r"""Backslash e at end of *line* froze SWIG
*with* old comment parser.
@ -107,7 +107,7 @@ See also: MyClass::fun(char,
)
commentVerifier.check(inspect.getdoc(doxygen_misc_constructs.cycle),
comment_verifier.check(inspect.getdoc(doxygen_misc_constructs.cycle),
r"""The next line contains expression:
['retVal < 10', 'g_counter == 23 && g_mode & 3']

View file

@ -5,20 +5,20 @@ import inspect
import string
import os
import sys
import commentVerifier
import comment_verifier
commentVerifier.check(inspect.getdoc(doxygen_parsing.someFunction),
comment_verifier.check(inspect.getdoc(doxygen_parsing.someFunction),
"The function comment")
commentVerifier.check(inspect.getdoc(doxygen_parsing.SomeClass),
comment_verifier.check(inspect.getdoc(doxygen_parsing.SomeClass),
"The class comment")
commentVerifier.check(inspect.getdoc(doxygen_parsing.SomeStruct),
comment_verifier.check(inspect.getdoc(doxygen_parsing.SomeStruct),
"The struct comment")
# There doesn't seem to be any way to specify the doc string for __init__ when
# using "-builtin" (see http://stackoverflow.com/q/11913492/15275), so skip
# this test in this case.
if str(os.environ.get('SWIG_FEATURES')).find('-builtin') == -1:
commentVerifier.check(inspect.getdoc(doxygen_parsing.SomeAnotherClass.__init__),
comment_verifier.check(inspect.getdoc(doxygen_parsing.SomeAnotherClass.__init__),
r"""*Overload 1:*
First overloaded constructor.
@ -27,11 +27,11 @@ First overloaded constructor.
*Overload 2:*
Second overloaded constructor.""")
commentVerifier.check(inspect.getdoc(doxygen_parsing.SomeAnotherClass.classMethod),
comment_verifier.check(inspect.getdoc(doxygen_parsing.SomeAnotherClass.classMethod),
r"""The class method comment.
SomeAnotherClass#classMethodExtended(int, int) a link text""")
commentVerifier.check(inspect.getdoc(doxygen_parsing.SomeAnotherClass.classMethodExtended),
comment_verifier.check(inspect.getdoc(doxygen_parsing.SomeAnotherClass.classMethodExtended),
r"""The class method with parameter
:type a: int
@ -39,7 +39,7 @@ commentVerifier.check(inspect.getdoc(doxygen_parsing.SomeAnotherClass.classMetho
:type b: int
:param b: Parameter b"""
)
commentVerifier.check(inspect.getdoc(doxygen_parsing.SomeAnotherClass.classMethodExtended2),
comment_verifier.check(inspect.getdoc(doxygen_parsing.SomeAnotherClass.classMethodExtended2),
r"""The class method with parameter
:type a: int
@ -47,9 +47,9 @@ commentVerifier.check(inspect.getdoc(doxygen_parsing.SomeAnotherClass.classMetho
:type b: int
:param b: Parameter b"""
)
commentVerifier.check(inspect.getdoc(doxygen_parsing.SomeAnotherStruct.structMethod),
comment_verifier.check(inspect.getdoc(doxygen_parsing.SomeAnotherStruct.structMethod),
r"""The struct method comment""")
commentVerifier.check(inspect.getdoc(doxygen_parsing.SomeAnotherStruct.structMethodExtended),
comment_verifier.check(inspect.getdoc(doxygen_parsing.SomeAnotherStruct.structMethodExtended),
r"""The struct method with parameter
:type a: int
@ -57,7 +57,7 @@ commentVerifier.check(inspect.getdoc(doxygen_parsing.SomeAnotherStruct.structMet
:type b: int
:param b: Parameter b"""
)
commentVerifier.check(inspect.getdoc(doxygen_parsing.SomeAnotherStruct.structMethodExtended2),
comment_verifier.check(inspect.getdoc(doxygen_parsing.SomeAnotherStruct.structMethodExtended2),
r"""The struct method with parameter
:type a: int

View file

@ -4,10 +4,10 @@ import doxygen_translate_all_tags
import inspect
import string
import sys
import commentVerifier
import comment_verifier
commentVerifier.check(inspect.getdoc(doxygen_translate_all_tags.func01),
comment_verifier.check(inspect.getdoc(doxygen_translate_all_tags.func01),
r"""*Hello*
@ -41,7 +41,7 @@ Not everything works right now...
some test code""")
commentVerifier.check(inspect.getdoc(doxygen_translate_all_tags.func02),
comment_verifier.check(inspect.getdoc(doxygen_translate_all_tags.func02),
r"""Conditional comment: SOMECONDITION
Some conditional comment
End of conditional comment.
@ -65,7 +65,7 @@ Deprecated: Now use another function
This is very large
and detailed description of some thing""")
commentVerifier.check(inspect.getdoc(doxygen_translate_all_tags.func03),
comment_verifier.check(inspect.getdoc(doxygen_translate_all_tags.func03),
r"""Comment for **func03()**.
@ -85,7 +85,7 @@ emphazedWord
Example: someFile.txt
Some details on using the example""")
commentVerifier.check(inspect.getdoc(doxygen_translate_all_tags.func04),
comment_verifier.check(inspect.getdoc(doxygen_translate_all_tags.func04),
r""":raises: SuperError
@ -116,7 +116,7 @@ r""":raises: SuperError
This will only appear in hmtl""")
commentVerifier.check(inspect.getdoc(doxygen_translate_all_tags.func05),
comment_verifier.check(inspect.getdoc(doxygen_translate_all_tags.func05),
r"""If: ANOTHERCONDITION {
First part of comment
If: SECONDCONDITION {
@ -150,7 +150,7 @@ Image: testImage.bmp("Hello, world!")
Some text
describing invariant.""")
commentVerifier.check(inspect.getdoc(doxygen_translate_all_tags.func06),
comment_verifier.check(inspect.getdoc(doxygen_translate_all_tags.func06),
r"""Comment for **func06()**.
@ -175,7 +175,7 @@ someMember Some description follows
This will only appear in man""")
commentVerifier.check(inspect.getdoc(doxygen_translate_all_tags.func07),
comment_verifier.check(inspect.getdoc(doxygen_translate_all_tags.func07),
r"""Comment for **func07()**.
@ -204,7 +204,7 @@ Maybe even multiline
:type a: int
:param a: the first param""")
commentVerifier.check(inspect.getdoc(doxygen_translate_all_tags.func08),
comment_verifier.check(inspect.getdoc(doxygen_translate_all_tags.func08),
r"""Text after anchor.
@ -239,7 +239,7 @@ Another remarks section
:rtype: void
:return: may return""")
commentVerifier.check(inspect.getdoc(doxygen_translate_all_tags.func09),
comment_verifier.check(inspect.getdoc(doxygen_translate_all_tags.func09),
r"""This will only appear in RTF
@ -274,7 +274,7 @@ Since: version 0.0.0.1
:raises: RuntimeError""")
commentVerifier.check(inspect.getdoc(doxygen_translate_all_tags.func10),
comment_verifier.check(inspect.getdoc(doxygen_translate_all_tags.func10),
r"""TODO: Some very important task
:type b: float

View file

@ -4,10 +4,10 @@ import doxygen_translate_links
import inspect
import string
import sys
import commentVerifier
import comment_verifier
commentVerifier.check(inspect.getdoc(doxygen_translate_links.function),
comment_verifier.check(inspect.getdoc(doxygen_translate_links.function),
r"""Testing typenames converting in @ link
superFunc(int,std::string)

View file

@ -4,10 +4,10 @@ import doxygen_translate
import inspect
import string
import sys
import commentVerifier
import comment_verifier
commentVerifier.check(inspect.getdoc(doxygen_translate.function),
comment_verifier.check(inspect.getdoc(doxygen_translate.function),
r"""*Hello*
* some list item
@ -140,7 +140,7 @@ And here goes simple text"""
commentVerifier.check(inspect.getdoc(doxygen_translate.htmlFunction),
comment_verifier.check(inspect.getdoc(doxygen_translate.htmlFunction),
r"""Test for html tags. See Doxygen doc for list of tags recognized by Doxygen.
This is link ("http://acme.com/index.html")
@ -224,7 +224,7 @@ Starts a piece of text displayed in a typewriter font.
<u>underlined \b bold text - doxy commands are ignored inside 'htmlonly' section </u>""")
commentVerifier.check(inspect.getdoc(doxygen_translate.htmlTableFunction),
comment_verifier.check(inspect.getdoc(doxygen_translate.htmlTableFunction),
r"""The meaning of flags:
:type byFlags: int
@ -240,7 +240,7 @@ r"""The meaning of flags:
``htmlTable...`` functions.""")
commentVerifier.check(inspect.getdoc(doxygen_translate.htmlEntitiesFunction),
comment_verifier.check(inspect.getdoc(doxygen_translate.htmlEntitiesFunction),
r"""All entities are treated as commands (C) TM (R)
should work also<in text
>