Skip to content

Adding type hints to the code #1539

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

Closed
XDRAGON2002 opened this issue Jan 20, 2022 · 8 comments
Closed

Adding type hints to the code #1539

XDRAGON2002 opened this issue Jan 20, 2022 · 8 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@XDRAGON2002
Copy link
Contributor

Although static declarations are present in the codebase, it is not uniform throughout.
This issue aims to get the entire project typed, so as to allow mypy enforcement in the future.
I believe working on this issue will help anyone trying to familiarize themselves to the project structure (also helps with easy and friendly PRs)

cve_bin_tool/version_signature.py
cve_bin_tool/version_scanner.py
cve_bin_tool/util.py
cve_bin_tool/cvedb.py
cve_bin_tool/csv2cve.py
cve_bin_tool/file.py
cve_bin_tool/strings.py

These are some of the places which would serve as good starting points.
Also there might be more places where typing needs to be added, that I might have missed here, feel free to open a PR for them as well.

@XDRAGON2002
Copy link
Contributor Author

Roping in @terriko for verification of issue and adding of "good-first-issue/beginner/easy" issue tag for visibility.

@terriko
Copy link
Contributor

terriko commented Jan 20, 2022

We actually already have a similar open issue that has the flags:

But in the interest of making this easy for folk to find at the top of the latest issue list, I'm going to leave them both and put the correct tags on this one.

@terriko terriko added enhancement New feature or request good first issue Good for newcomers labels Jan 20, 2022
@attreyee-muk
Copy link

@terriko can I work on this issue? I am a beginner.

terriko pushed a commit that referenced this issue Feb 22, 2022
* related to #1539

* refactor: type hints in util.py

* refactor: arguments to new __new__

Co-authored-by: Dmitry Volodin <[email protected]>

* refactor: CVEData

Co-authored-by: Dmitry Volodin <[email protected]>

* refactor: simplifying type hints

Co-authored-by: Dmitry Volodin <[email protected]>

* refactor: type hints in regex_find

Co-authored-by: Dmitry Volodin <[email protected]>

* refactor: imports in util.py

Co-authored-by: Dmitry Volodin <[email protected]>

* refactor: simplifying type hints

Co-authored-by: Dmitry Volodin <[email protected]>

* refactor: simplifying type hints

Co-authored-by: Dmitry Volodin <[email protected]>

* refactor: improving type hints in util.py

* fix: inline type hints

Co-authored-by: Dmitry Volodin <[email protected]>

* fix: imports for inline type hints

Co-authored-by: Dmitry Volodin <[email protected]>
terriko pushed a commit to terriko/cve-bin-tool that referenced this issue Mar 9, 2022
* related to intel#1539

* refactor: type hints in util.py

* refactor: arguments to new __new__

Co-authored-by: Dmitry Volodin <[email protected]>

* refactor: CVEData

Co-authored-by: Dmitry Volodin <[email protected]>

* refactor: simplifying type hints

Co-authored-by: Dmitry Volodin <[email protected]>

* refactor: type hints in regex_find

Co-authored-by: Dmitry Volodin <[email protected]>

* refactor: imports in util.py

Co-authored-by: Dmitry Volodin <[email protected]>

* refactor: simplifying type hints

Co-authored-by: Dmitry Volodin <[email protected]>

* refactor: simplifying type hints

Co-authored-by: Dmitry Volodin <[email protected]>

* refactor: improving type hints in util.py

* fix: inline type hints

Co-authored-by: Dmitry Volodin <[email protected]>

* fix: imports for inline type hints

Co-authored-by: Dmitry Volodin <[email protected]>
terriko pushed a commit that referenced this issue Mar 10, 2022
terriko added a commit that referenced this issue Mar 10, 2022
@gaurav879
Copy link
Contributor

gaurav879 commented Apr 13, 2022

I would like to work on this issue.

@terriko
Copy link
Contributor

terriko commented Oct 12, 2022

Anyone interested on working on this: I'm filing some new issues on specific files, feel free to grab one if you want!

@kishan3
Copy link
Contributor

kishan3 commented Oct 19, 2022

I am interested thank you.

@terriko
Copy link
Contributor

terriko commented Oct 25, 2022

Anyone interested:

I'm still filing new issues for specific files. If there's none available, you can check yourself to see what mypy errors remain by installing mypy using

pip install mypy

Then running

mypy cve_bin_tool/

or

mypy test/

And seeing what files still have errors. You can open your own issue for any file that I don't already have an issue set up for, and open your own PR for any file that still has errors and no open PR fixing them.

@terriko
Copy link
Contributor

terriko commented Apr 18, 2023

Closing all the mypy/type hint issues because I'm not prepared to work on them right now and I don't want new contributors to trip over them first. Some of them have been solved but weren't closed properly, some have open pull requests in progress and will be closed eventually, some could benefit from re-running mypy.

@terriko terriko closed this as completed Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants