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

View file

@ -2,9 +2,9 @@
import doxygen_alias import doxygen_alias
import inspect 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. A function returning something.

View file

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

View file

@ -4,9 +4,9 @@ import doxygen_basic_translate
import inspect import inspect
import string import string
import sys 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. Brief description.
@ -19,12 +19,12 @@ Author: Some author
See also: function2""" 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 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.""" 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:* """*Overload 1:*
A test for overloaded functions A test for overloaded functions
@ -37,7 +37,7 @@ This is function **one**
A test for overloaded functions A test for overloaded functions
This is function **two**""" 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 A test of some mixed tag usage
If: CONDITION { 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.""" """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 Test for default args
:type a: int :type a: int
:param a: Some parameter, default is 42""" :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 Test for a parameter with difficult type
(mostly for python) (mostly for python)
@ -73,7 +73,7 @@ Test for a parameter with difficult type
:param a: Very strange param""" :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. Multiple parameters test.

View file

@ -2,9 +2,9 @@
import doxygen_ignore import doxygen_ignore
import inspect 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. A contrived example of ignoring too many commands in one comment.

View file

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

View file

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

View file

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

View file

@ -4,10 +4,10 @@ import doxygen_translate_links
import inspect import inspect
import string import string
import sys 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 r"""Testing typenames converting in @ link
superFunc(int,std::string) superFunc(int,std::string)

View file

@ -4,10 +4,10 @@ import doxygen_translate
import inspect import inspect
import string import string
import sys import sys
import commentVerifier import comment_verifier
commentVerifier.check(inspect.getdoc(doxygen_translate.function), comment_verifier.check(inspect.getdoc(doxygen_translate.function),
r"""*Hello* r"""*Hello*
* some list item * 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. r"""Test for html tags. See Doxygen doc for list of tags recognized by Doxygen.
This is link ("http://acme.com/index.html") 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>""") <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: r"""The meaning of flags:
:type byFlags: int :type byFlags: int
@ -240,7 +240,7 @@ r"""The meaning of flags:
``htmlTable...`` functions.""") ``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) r"""All entities are treated as commands (C) TM (R)
should work also<in text should work also<in text
> >