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

ruff select perflint flake8-slots #395

Merged
merged 2 commits into from
Jun 26, 2023
Merged

ruff select perflint flake8-slots #395

merged 2 commits into from
Jun 26, 2023

Conversation

janosh
Copy link
Member

@janosh janosh commented Jun 21, 2023

PEP 484 prohibits implicit Optional. To be a good Python citizen, this PR removes implicit optionals from all type hints.

@codecov
Copy link

codecov bot commented Jun 21, 2023

Codecov Report

Merging #395 (4f7231d) into main (02e44c0) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #395      +/-   ##
==========================================
- Coverage   64.96%   64.95%   -0.02%     
==========================================
  Files          74       74              
  Lines        7196     7193       -3     
  Branches      946      946              
==========================================
- Hits         4675     4672       -3     
  Misses       2221     2221              
  Partials      300      300              
Impacted Files Coverage Δ
src/atomate2/common/schemas/cclib.py 73.82% <100.00%> (-0.18%) ⬇️
src/atomate2/cp2k/schemas/task.py 82.72% <100.00%> (-0.08%) ⬇️
src/atomate2/lobster/schemas.py 92.91% <100.00%> (-0.03%) ⬇️

@utf
Copy link
Member

utf commented Jun 23, 2023

Personally, I'm not in favour of this. I really don't see the point of having to add the optional type when the default value is None. Mypy understands it fine. It just seems like extra boilerplate.

However, if there are other strong opinions I will hear them.

Edit: I didn't mean to close it.

@utf utf closed this Jun 23, 2023
@utf utf reopened this Jun 23, 2023
@janosh janosh force-pushed the mypy-no-implicit-optional branch from b4437ce to 5146d66 Compare June 23, 2023 16:06
@janosh
Copy link
Member Author

janosh commented Jun 23, 2023

@utf Don't feel strongly. I agree it's boilerplate even if more rigorous. I reverted the Optional changes and ignored the ruff rule RUF013 that applied them.

@janosh janosh changed the title Remove all implicit optional types ruff select perflint flake8-slots Jun 23, 2023
@utf
Copy link
Member

utf commented Jun 26, 2023

Great, thank you.

@utf utf merged commit 896604a into main Jun 26, 2023
13 checks passed
@janosh janosh deleted the mypy-no-implicit-optional branch June 26, 2023 15:21
@utf utf added enhancement Improvements to existing features house-keeping Formatting and code quality tweaks and removed enhancement Improvements to existing features labels Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
house-keeping Formatting and code quality tweaks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants