docstring-generator-ext 2.0.4__tar.gz → 2.0.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/PKG-INFO +1 -1
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/docstring_generator_ext.egg-info/PKG-INFO +1 -1
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/pyproject.toml +1 -1
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/src/docComparator.cpp +18 -14
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/MANIFEST.in +0 -0
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/README.md +0 -0
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/docstring_generator_ext.egg-info/SOURCES.txt +0 -0
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/docstring_generator_ext.egg-info/dependency_links.txt +0 -0
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/docstring_generator_ext.egg-info/requires.txt +0 -0
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/docstring_generator_ext.egg-info/top_level.txt +0 -0
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/setup.cfg +0 -0
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/setup.py +0 -0
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/src/FunctionFormat.cpp +0 -0
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/src/FunctionFormat.hpp +0 -0
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/src/GoogleDocstring.cpp +0 -0
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/src/GoogleDocstring.hpp +0 -0
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/src/IDocstringFormat.cpp +0 -0
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/src/IDocstringFormat.hpp +0 -0
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/src/NumpyDocstring.cpp +0 -0
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/src/NumpyDocstring.hpp +0 -0
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/src/ReStructuredDocstring.cpp +0 -0
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/src/ReStructuredDocstring.hpp +0 -0
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/src/docComparator.hpp +0 -0
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/src/docstringFormat.cpp +0 -0
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/src/docstringFormat.hpp +0 -0
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/src/parser.cpp +0 -0
- {docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/src/parser.hpp +0 -0
|
@@ -13,7 +13,10 @@ DocstringComparisonResult compare_docstrings(
|
|
|
13
13
|
bool return_information_visible = false;
|
|
14
14
|
bool exception_information_visible = false;
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
if (function_info.returns.type == "None" || function_info.returns.line_no == 0)
|
|
17
|
+
return_information_visible = true;
|
|
18
|
+
|
|
19
|
+
size_t last_pos = current_docstring.end_line - current_docstring.start_line;
|
|
17
20
|
|
|
18
21
|
// check function arguments from FunctionInfo
|
|
19
22
|
function_arguments_visible = std::ranges::all_of(
|
|
@@ -29,11 +32,17 @@ DocstringComparisonResult compare_docstrings(
|
|
|
29
32
|
last_pos = pos + arg.name.size();
|
|
30
33
|
}
|
|
31
34
|
|
|
32
|
-
if (!arg.type.empty())
|
|
33
|
-
|
|
35
|
+
if (!arg.type.empty()) {
|
|
36
|
+
const auto pos = current_docstring.docstring.find(arg.type, last_pos);
|
|
37
|
+
match &= pos != std::string::npos;
|
|
38
|
+
if (pos != std::string::npos)
|
|
39
|
+
last_pos = pos + arg.type.size();
|
|
40
|
+
}
|
|
34
41
|
|
|
35
|
-
if (!arg.default_value.empty())
|
|
42
|
+
if (!arg.default_value.empty()) {
|
|
36
43
|
match &= current_docstring.docstring.find(arg.default_value, last_pos) != std::string::npos;
|
|
44
|
+
last_pos += arg.default_value.size();
|
|
45
|
+
}
|
|
37
46
|
|
|
38
47
|
if (!arg.description.empty()) {
|
|
39
48
|
const auto pos = current_docstring.docstring.find(arg.description, last_pos);
|
|
@@ -51,14 +60,9 @@ DocstringComparisonResult compare_docstrings(
|
|
|
51
60
|
bool match = false;
|
|
52
61
|
if (!function_info.returns.type.empty()) {
|
|
53
62
|
const auto pos = current_docstring.docstring.find(function_info.returns.type, last_pos);
|
|
63
|
+
match = pos != std::string::npos;
|
|
54
64
|
if (pos != std::string::npos) {
|
|
55
|
-
|
|
56
|
-
if (end_pos == std::string::npos)
|
|
57
|
-
end_pos = current_docstring.docstring.size();
|
|
58
|
-
const auto tmp = current_docstring.docstring.substr(pos, end_pos);
|
|
59
|
-
last_pos = end_pos;
|
|
60
|
-
if (tmp.size() == function_info.returns.type.size())
|
|
61
|
-
match = true;
|
|
65
|
+
last_pos = pos + function_info.returns.type.size() + function_info.returns.description.size();
|
|
62
66
|
}
|
|
63
67
|
}
|
|
64
68
|
|
|
@@ -70,12 +74,12 @@ DocstringComparisonResult compare_docstrings(
|
|
|
70
74
|
// check exception information from FunctionInfo
|
|
71
75
|
exception_information_visible = std::ranges::all_of(
|
|
72
76
|
function_info.exceptions,
|
|
73
|
-
[¤t_docstring](const auto &exception) {
|
|
77
|
+
[&last_pos, ¤t_docstring](const auto &exception) {
|
|
74
78
|
bool match = false;
|
|
75
79
|
if (!exception.name.empty())
|
|
76
|
-
match = current_docstring.docstring.find(exception.name) != std::string::npos;
|
|
80
|
+
match = current_docstring.docstring.find(exception.name, last_pos) != std::string::npos;
|
|
77
81
|
if (!exception.description.empty())
|
|
78
|
-
match &= current_docstring.docstring.find(exception.description) != std::string::npos;
|
|
82
|
+
match &= current_docstring.docstring.find(exception.description, last_pos) != std::string::npos;
|
|
79
83
|
return match;
|
|
80
84
|
}
|
|
81
85
|
);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/src/ReStructuredDocstring.cpp
RENAMED
|
File without changes
|
{docstring_generator_ext-2.0.4 → docstring_generator_ext-2.0.5}/src/ReStructuredDocstring.hpp
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|