-
Notifications
You must be signed in to change notification settings - Fork 0
feat: api
command should extract source code of api elements
#1111
feat: api
command should extract source code of api elements
#1111
Conversation
🦙 MegaLinter status: ✅ SUCCESS
See errors details in artifact MegaLinter reports on CI Job page |
I have two questions:
|
A function like
For the sake of easy (manual) testing, it makes sense to update the data folder. Just include the license file from scikit-learn as well in the |
I compared output of the alternatives and found out that the as_string method ignores comments in the code, but it includes decorators. With a change from fromlineno to lineno decorators would be visible at the current process. Also, it seems that as_string() rearrange lines by removing comments. Original
and what as_string() converts it to:
If the comment line were removed in a new version, there would be a few new lines when we change to as_string(). |
Let's discuss this tomorrow. |
from classes, and (global) functions
with included license
and hopefully the error disapperears
10744bd
to
a05685a
Compare
using cleandoc, outlined method and renamed license
Please resolve conversations yourself once you are done with them. |
🎉 This PR is included in version 1.67.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Closes #1106.
Summary of Changes
added an attribute
code
to functions and classes that contain the unformatted source code of the function or classTesting Instructions
run
package-parser api -p sklearn -o ./out
and compare the output with the original file that the element contains.package-parser annotations -a ../data/api/sklearn__api.json -u ../data/usages/sklearn_usages_counts.json -o ./out/annotations.json
can verify that no error occur if the file is loaded.