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

Add fixer for required on_delete argument #61

Merged
merged 5 commits into from
Sep 19, 2021

Conversation

browniebroke
Copy link
Contributor

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Sep 18, 2021

Codecov Report

Merging #61 (6580366) into main (f42bdd7) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main       #61   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           24        25    +1     
  Lines          765       793   +28     
  Branches       128       132    +4     
=========================================
+ Hits           765       793   +28     
Impacted Files Coverage Δ
src/django_upgrade/fixers/on_delete.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f42bdd7...6580366. Read the comment docs.

@browniebroke browniebroke marked this pull request as ready for review September 18, 2021 12:13
Copy link
Owner

@adamchainz adamchainz left a comment

Choose a reason for hiding this comment

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

LGTM. One thing is we could insert the argument first, after any positional args, rather than last. This would require passing the number of positional arguments through to add_on_delete_keyword It's more informational than other field arguments.

tests/fixers/test_on_delete.py Outdated Show resolved Hide resolved
src/django_upgrade/fixers/on_delete.py Outdated Show resolved Hide resolved
HISTORY.rst Show resolved Hide resolved
README.rst Outdated Show resolved Hide resolved
@browniebroke
Copy link
Contributor Author

One thing is we could insert the argument first, after any positional args, rather than last. This would require passing the number of positional arguments through to add_on_delete_keyword It's more informational than other field arguments.

That's a good point, also on_delete is the second positional argument in the implementation, so that matches up well too. I'll try to make it work...

@adamchainz
Copy link
Owner

I made a commit and it looks okay to me, so merging! Thanks!

@browniebroke
Copy link
Contributor Author

Thanks for finishing it up 👍🏻

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.

None yet

3 participants