This error is given for any use of variable called "l" (and also "I" and
"O", but we don't seem to have any of those) and it doesn't seem to be
worth changing this variable name in the tests code, as it's really not
that meaningful there anyhow, so just disable the warning to let the CI
builds, which now use pycodestyle 2.6, instead of 2.5 which didn't have
this error and which is still the latest available in Debian Sid, pass.
The "endlink" command is processed in processWordCommands, which by
default skips space occuring after the command, which is intended for
removing leading space from a command argument. For "end" commands,
we don't want to do this. Note that certain end commands such as
"endcode" aren't processed by processWordCommands (believe
addCommandUnique ends up handling them).
Update usage of \link in doxygen_translate_all_tags.i to test handling
of space after \endlink.
Tweaking some of the usage in doxygen_misc_constructs.i to remove what
seems to be an extra space from the input (otherwise we would need to
add an extra space to the expected output).
In addition to the changes in the previous commit, also avoid syntax
errors in the generated Python docstrings by splitting them into several
parts if there are 3 quotes in a row in the input, as it's impossible to
have them inside triple-quoted strings, generally speaking (i.e. if
there are occurrences of both """ and ''' inside the string).
Single-line Doxygen comments ending with a double quote resulted in
syntactically-invalid Python docstrings in the output, so use triple
single quotes as delimiters in this case to avoid it.
This test code tests the upcast code:
swig_assert_equal_simple(-1, base_num2([Derived(7)]))
Although there is no explicit memory leak fix test, it does at least run the code.
Handling of None needs fixing in Python (it is working in Ruby)
Note that the Ruby implementation has a partial template specialization
for shared_ptr, whereas the Python implementation is in the generic
code!
Issue #1512
Don't attempt to use the class's __dict__ for setting 'this' when
a user has extended a class with:
__slots__ = ['this'].
Was segfaulting. Now we fall back to a simple PyObject_SetAttr if the
usual approach to setting 'this' in __dict__ does not work.
Closes#1673Closes#1674
Due to confusion in build_combined_docstring(), we could call
DohDelete() on the "feature:docstring" string, which resulted in a crash
when trying to use it later.
Fix this and simplify the code at the same time by ensuring that we
always use a copy of "feature:docstring" if it's not empty or don't use
it at all if it's empty -- like this we don't have to check for its
length each time before using it.
Closes#1648.
* Issue-1632:
Minor workaround in doxygen_basic_translate_style3 test
Add new test doxygen_basic_translate_style3.i
Fix for newline handling in doxygen "///" style comments
* doxy/commands:
Update documentation for doxygen tags
Fix doxygen translation of \p command for python
Fix doxygen handling of \em tag for python
Minor formatting updates to doxygen docs
Reformat tag lists in doxygen documentation
Add doxygen_code_blocks_runme.java
Special handling for python doctest code blocks
Add new doxygen test doxygen_code_blocks
Handle doxygen code command with language option
Improve doxygen parser handling of \code content
Flag optional arguments in doxygen pydoc output
Add parameter direction to doxygen pydoc output
Support doxygen \param[] commands
Instead of silenty ignoring them, now a "TypeError: f() takes no keyword arguments"
exception is thrown if keyword arguments are used. Hence constructors and normal
methods/functions behave in the same way.
Closes issue #1595
With the "///" doxygen comment style, comments within a code block do
not get handled correctly. Modifying the test to remove this case and
adding a note about it for future reference.
The fix is when using kwargs feature or -keyword.
The fix is in the argument error checking when wrapping zero
argument constructors only. Supplied keyword args were silently
ignored.
Issue #1595
Processing doxygen @param comments for a parameter whose name did not
appear in the function declaration would cause a segfault due to a
null pointer dereference.
Adding test cases for both variadic function (no specified arguments)
and @param comment that references an argument that is not named in
the function prototype. Both of these cases previously segfaulted.
A doctest code block begins with ">>>" and is not indented. Identify
these in doxygen comments and treat them accordingly. Also add check
to padCodeAndVerbatimBlocks for these because Sphinx requires an empty
line before.
Add test case to doxygen_code_blocks.i.
This does somewhat more detailed testing of the code block parsing,
and also exercises the language identification of python doctest
features. For now, it is only tested by python (javadoc translation
may not correctly handle some of the characters that are used here).
If the parameter has a default value, add the string ", optional" to
the parameter type description in the translated python comments.
Three examples with default values were already present in the test
cases, so their expected python output has been updated accordingly.
For doxygen comments that specify parameter direction (i.e.,
\param[in], \param[out], and \param[in,out]), the direction is
appended to the type definition in the generated Python documentation.
Updated expected python output for doxygen test case.
Recognize \param[in], \param[out], and \param[in,out]. Currently they
are all treated the same as \param, but the information is now
available for inclusion in the translated comments. This is done
using new utility functions getBaseCommand and getEndOfWordCommand,
which will also generalize to treatment of code command options,
e.g. \code{.py}. Preliminary treatment of the extended version of
\code is already in place in these functions.
Added examples of all three new \param commands to the
doxygen_translate_all_tags test and updated the python and java
expected output.
This testcase was only run in Ruby and Python and implements an
obscure feature where a C++ class inherits from a std::wstring.
The li_std_wstring test is left in place to be modified in next commit
for more regular wstring testing across all languages.
* annotation_quoting:
Examples: Unify string quoting in the Python sources
Test-suite: Unify string quoting in the Python sources
Tools: Unify string quoting in the Python sources
Generator: Unify string quoting in generated Python sources
Generator: Remove trailing whitespaces in the Python module
Fix how end of paragraph is identified when parsing \code and
\verbatim blocks that appear within a paragraph and contain an empty
line. Previously this would generate a warning for unexpected end of
doxygen comments, and it could generate a segfault due to
dereferencing an invalid iterator value.
The doxygen_basic_translate.i and doxygen_basic_translate_style2.i
tests have been updated to serve as regression tests for this
behavior. Prior to this fix, inclusion of the empty code block line
in this context produced a segfault.
Sphinx requires an empty line before code and math blocks, whereas
doxygen does not. This update ensures that a blank line is included
before generated code and math blocks in the pydoc output. This is
done by post-processing the docstring line by line to check whether
any newlines need to be added. This way, if the original doxygen
source already includes an empty line before a block, an additional
unnecessary empty line is not added.
Updating the expected test output for doxygen_basic_translate, which
now adds the necessary empty line before the code block. Adding
further test cases to doxygen_translate_all_tags to explicitly verify
that a newline is added in the pydoc output before both code and math
blocks that appear within a paragraph.
Additionally, empty lines previously appearing at the beginning of the
generated docstrings are now removed. This does not alter the
behavior of the tests.
Remove a newline character that was added to the translated comments
prior to the code block. This way the structure of the pydoc output
more closely resembles that of the original doxygen comments.
Updating tests accordingly.
The _runme.py code for the recently added test case was using
references to an old module name for the test case, which was later
changed but not updated in the runme file.
Observed that with this second comment style, there is no line break
after the function overload headings in the translated
comments. Updating the test results accordingly.
This style looks like:
/** Line 1
* Line 2
*/
This is needed to verify fixes to some of the indentation in the
translated comments.
The test is copied from doxygen_basic_translate.i. One adjustment was
made to change the comment style on the last function that left out
the intermediate "*" characters. This does not produce correct output
when combined with this style of starting the text on the first
comment line.
Test results are copied directly from doxygen_basic_translate. A
minor difference in the Python results will be updated in a subsequent
commit.
Eliminate extra leading and trailing newlines around the \f[ and \f{
block math commands for doxygen comment translation for python.
Update tests accordingly.
If \code is used as a block command (probably the main use case), an
extra newline was included in the translated Python comments. This is
now removed and doxygen python test case output updated.
If \code was used inline, it produced an extra indent versus block
usage. This extra indent was also stored in the test output. This
update resolves this by simply removing a space that was being added
unnecessarily in handleTagVerbatim. Updating test case output
accordingly.
The low-level API for setting static member variables stopped working
when the fastunpack option was turned on by default. The PyMethodDef
setup requires METH_O, not METH_VARARGS with fastunpack.