Skip to content
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

Improved code style and fixed typos #1157

Merged
merged 14 commits into from
Jan 24, 2024

Conversation

michaelehab
Copy link
Collaborator

What

I modified the datasources files to follow PEP 8 more closely. They were already following it but they missed some small details like the docstrings. I also fixed some typos found in the vulntotal_utils.py file and other files.

Why

I made these changes to improve the readability and consistency of the code. Following PEP 8 helps to maintain a high standard of code quality and style. Fixing typos helps to avoid confusion and errors.

Anything else

Please let me know if you have any questions or feedback. Thank you for reviewing my PR!

@keshav-space
Copy link
Member

To ensure consistent code formatting, we use Black and isort. To auto-format the code, run the make valid command.

Add a Developer Certificate of Origin (DCO) to your commit. This certifies that you have the right to submit the code under an open-source license.

How to write good commit messages? Refer to this guide: https://aboutcode.readthedocs.io/en/latest/contributing/writing_good_commit_messages.html

@keshav-space keshav-space added the VulnTotal Tool for cross-validating vulnerability label Mar 25, 2023
Signed-off-by: Michael Ehab <michaelehab16@gmail.com>
Signed-off-by: Michael Ehab <michaelehab16@gmail.com>
Signed-off-by: Michael Ehab <michaelehab16@gmail.com>
Signed-off-by: Michael Ehab <michaelehab16@gmail.com>
Signed-off-by: Michael Ehab <michaelehab16@gmail.com>
Signed-off-by: Michael Ehab <michaelehab16@gmail.com>
Signed-off-by: Michael Ehab <michaelehab16@gmail.com>
Signed-off-by: Michael Ehab <michaelehab16@gmail.com>
To ensure consistent code formatting, I used Black and isort to format the changed files.

Signed-off-by: Michael Ehab <michaelehab16@gmail.com>
Fixed more typos and formated the files

Signed-off-by: Michael Ehab <michaelehab16@gmail.com>
Copy link
Member

@keshav-space keshav-space left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @michaelehab

Use consistent format for docstring see comments below

vulntotal/datasources/gitlab.py Outdated Show resolved Hide resolved
vulntotal/datasources/oss_index.py Outdated Show resolved Hide resolved
…tone

Changed the doctrings to have a consistent format and used Black and isort to format the changed files.

Signed-off-by: Michael Ehab <michaelehab16@gmail.com>
@TG1999
Copy link
Contributor

TG1999 commented Dec 12, 2023

@keshav-space please review when you get chance

Copy link
Member

@keshav-space keshav-space left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @michaelehab
See the few suggestions below, and also need to resolve the conflicts before we can merge this.

vulntotal/datasources/osv.py Outdated Show resolved Hide resolved
vulntotal/datasources/osv.py Outdated Show resolved Hide resolved
vulntotal/datasources/snyk.py Outdated Show resolved Hide resolved
Copy link
Member

@keshav-space keshav-space left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @michaelehab
I have reverted some undesirable refactoring.

@keshav-space keshav-space merged commit e844bb2 into aboutcode-org:main Jan 24, 2024
6 of 7 checks passed
TG1999 pushed a commit to TG1999/vulnerablecode that referenced this pull request Jul 19, 2024
* style: modified snyk datasource file to follow pep 8

Signed-off-by: Michael Ehab <michaelehab16@gmail.com>

* style: modified osv datasource file to follow pep 8

Signed-off-by: Michael Ehab <michaelehab16@gmail.com>

* style: modified oss datasource file to follow pep 8

Signed-off-by: Michael Ehab <michaelehab16@gmail.com>

* style: modified vulnerablecode datasource file to follow pep 8

Signed-off-by: Michael Ehab <michaelehab16@gmail.com>

* style: modified gitlab datasource file to follow pep 8

Signed-off-by: Michael Ehab <michaelehab16@gmail.com>

* style: modified gitlab datasource file to follow pep 8

Signed-off-by: Michael Ehab <michaelehab16@gmail.com>

* style: modified deps.py file to follow pep 8

Signed-off-by: Michael Ehab <michaelehab16@gmail.com>

* Fixed some typos

Signed-off-by: Michael Ehab <michaelehab16@gmail.com>

* Format code with Black and isort

To ensure consistent code formatting, I used Black and isort to format the changed files.

Signed-off-by: Michael Ehab <michaelehab16@gmail.com>

* Fix more typos in vulntotal tool

Fixed more typos and formated the files

Signed-off-by: Michael Ehab <michaelehab16@gmail.com>

* Use a consistent format for the docstring and maintain an imperative tone

Changed the doctrings to have a consistent format and used Black and isort to format the changed files.

Signed-off-by: Michael Ehab <michaelehab16@gmail.com>

* Handle TypeError and IndexError raised by get_item

Signed-off-by: Keshav Priyadarshi <git@keshav.space>

* Revert incorrect refactoring

Signed-off-by: Keshav Priyadarshi <git@keshav.space>

---------

Signed-off-by: Michael Ehab <michaelehab16@gmail.com>
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
Co-authored-by: Keshav Priyadarshi <git@keshav.space>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
VulnTotal Tool for cross-validating vulnerability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants