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

Updates to fix-mutable-params codemod #141

Merged
merged 3 commits into from
Nov 20, 2023
Merged

Updates to fix-mutable-params codemod #141

merged 3 commits into from
Nov 20, 2023

Conversation

drdavella
Copy link
Member

@drdavella drdavella commented Nov 17, 2023

Overview

Updates to fix-mutable-params

Description

  • Do not modify type annotations that are already Optional
  • Do not modify the body of abstractmethods

Copy link

codecov bot commented Nov 17, 2023

Codecov Report

Merging #141 (4c55b12) into main (cded591) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #141      +/-   ##
==========================================
+ Coverage   96.33%   96.35%   +0.01%     
==========================================
  Files          66       66              
  Lines        2732     2743      +11     
==========================================
+ Hits         2632     2643      +11     
  Misses        100      100              
Files Coverage Δ
src/core_codemods/fix_mutable_params.py 100.00% <100.00%> (ø)

def _is_abstractmethod(self, node: cst.FunctionDef) -> bool:
for decorator in node.decorators:
match decorator.decorator:
case cst.Name("abstractmethod"):
Copy link
Member Author

Choose a reason for hiding this comment

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

Could possibly be more accurate and guarantee this is imported from abc, but it's probably pretty reliable as-is.

@drdavella drdavella marked this pull request as ready for review November 17, 2023 21:38
@drdavella drdavella added this pull request to the merge queue Nov 20, 2023
Merged via the queue into main with commit b1e0e3d Nov 20, 2023
13 checks passed
@drdavella drdavella deleted the fix-type-annotations branch November 20, 2023 15:07
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

Successfully merging this pull request may close these issues.

2 participants