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

Respect placement of docstrings in fix-mutable-params #58

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

drdavella
Copy link
Member

Overview

Respect placement of docstrings in fix-mutable-params codemod

Description

  • We don't want to place any new statements before the docstring if present

expected_output = """
def func(foo=None):
foo = [] if foo is None else foo
# Here is a comment
Copy link
Member Author

Choose a reason for hiding this comment

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

In general we can't know whether a comment was intended as belonging to the function decl or the first statement, so we don't preserve the position.

@codecov-commenter
Copy link

codecov-commenter commented Oct 2, 2023

Codecov Report

Merging #58 (f1ec8ef) into main (54af0ab) will increase coverage by 0.02%.
Report is 1 commits behind head on main.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #58      +/-   ##
==========================================
+ Coverage   96.24%   96.26%   +0.02%     
==========================================
  Files          43       43              
  Lines        1623     1632       +9     
==========================================
+ Hits         1562     1571       +9     
  Misses         61       61              
Files Coverage Δ
src/core_codemods/fix_mutable_params.py 100.00% <100.00%> (ø)

@drdavella drdavella marked this pull request as ready for review October 2, 2023 20:30
@drdavella drdavella merged commit 8ac9fc9 into main Oct 3, 2023
6 checks passed
@drdavella drdavella deleted the respect-docstrings branch October 3, 2023 14:50
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.

4 participants