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

Fix all public functions that do not have return type annotations #2307

Open
sunnygurm opened this issue Dec 14, 2023 · 2 comments
Open

Fix all public functions that do not have return type annotations #2307

sunnygurm opened this issue Dec 14, 2023 · 2 comments

Comments

@sunnygurm
Copy link
Contributor

Describe the bug
While getting familiar with the repository and codebase, I ran ruff check --select ANN201 ./cvxpy to see how many issues existed relating to return type annotations for public functions.

There are 930 such instances as of today (Dec 14 2023).

More details for ANN201 errors and why it might be good to fix them can be found here.

To Reproduce
See output logs of ruff check --select ANN201 ./cvxpy

Expected behavior
ruff check --select ANN201 ./cvxpy should not return any errors

Output
N/A

Version
N/A

Additional context
See this PR for additional context.

A proposed approach to cut down on these errors could be:

  • Pick a directory that has these errors
  • Fix the issues in that directory; submit a tightly scoped PR (IMHO I don't think 'tackling all 900 errors at once' is a good approach because it would blow up the scope and review time of the PR)

This is a really good 'first issue' for someone getting familiar with the repository.

@Transurgeon
Copy link
Contributor

Hi @sunnygurm thank you for opening this issue.
I was wondering if it would be possible to check for missing return type annotations automatically in future commits? (using pre-commit).
Perhaps it would be a better idea to add that after all 930 such instances have been resolved.. :). But imo it could be nice to catch that as an error for future commits.

@sunnygurm
Copy link
Contributor Author

@Transurgeon agreed! I think once we're in good shape we can add this check to the pre-commit hook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants