-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose library commands #45
Expose library commands #45
Conversation
Hey @andrewdea, thank you for your contribution! This is a use case I didn't consider, and I find it really useful, so I appreciate these changes. |
Can you please create an issue to relate this PR? And a new issue to discuss the new languages to support them. |
@rohaquinlop thanks a lot for the comments!
|
@rohaquinlop applied the suggested changes, let me know if I'm missing anything 😃 |
The error at ...
runs-on: ubuntu-22.04
... @andrewdea We will ignore that error in this PR, there are another pipelines that are failing due to |
@andrewdea Can you please modify the ...
sdist:
runs-on: ubuntu-22.04
steps:
... It seems that without that, the unit tests won't run 😢 |
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The macOS pipeline is failing due to an error in the CI I'll fix that later, thank you so much for your contribution 🫶🏾
Hello and thank you for this really cool library!
I've tried using this from my python code, but I realized that I needed to expose some of the internal commands.
I made a couple of changes, outlined below. If possible, I would also like to help expand this library so that it can cover other languages besides python.
outline of changes
code_complexity
, that computes the complexity on a string of python codeThis way, we can evaluate the complexity on any string of code:
This is particularly useful in situations where we want to evaluate stand-alone snippets that might not be part of a file-system.
cognitive_complexity
was also really useful as a library command, so I exposed it at the python level. Because of Rust's naming rules, it seems it wouldn't allow me to keep that name: it would clash with the module of the same name. So I renamed the functionfunction_complexityfile_complexity
, which I thought would clarify how it differs fromcode_complexity
. I don't have a strong opinion on the function-names: feel free to propose better ones.Let me know what you think and if there's any edits you'd like me to make before merging, thanks again!
Related issue: #46