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 module rename support and URLResolversTransformer #123

Merged
merged 2 commits into from
Jul 20, 2020

Conversation

jayvdb
Copy link
Contributor

@jayvdb jayvdb commented Jul 4, 2020

No description provided.

@browniebroke browniebroke added the enhancement New feature or request label Jul 4, 2020
@browniebroke browniebroke added this to the Django 2.0 milestone Jul 4, 2020
@browniebroke
Copy link
Owner

Just making a note for documenting this later:

Deprecated in Django 1.10:

Importing from the django.core.urlresolvers module is deprecated in favor of its new location, django.urls.

And removed in Django 2.0:

The django.core.urlresolvers module will be removed.

@jayvdb jayvdb changed the title WIP: Add URLResolversTransformer Add module rename support and URLResolversTransformer Jul 5, 2020
Copy link
Owner

@browniebroke browniebroke left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks for this contribution. I've a couple of small comments on tests, I think it would be nice to add an extra one.

Could you please also update the documentation please?

django_codemod/visitors/core.py Show resolved Hide resolved
tests/visitors/test_base.py Show resolved Hide resolved
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jul 16, 2020

Sourcery Code Quality Report (beta)

✅ Merging this PR will increase code quality in the affected files by 0.07 out of 10.

Before After Change
Quality 9.25 9.32 0.07
Complexity 0.37 0.35 -0.03
Method Length 29.34 26.68 -2.66
Lines 500 557 57
Changed files Quality Before Quality After Quality Change
django_codemod/visitors/init.py 8.53 8.46 -0.07 ⬇️
django_codemod/visitors/base.py 9.09 9.25 0.16 ⬆️
django_codemod/visitors/core.py N/A 9.48 N/A
tests/test_cli.py 9.21 9.2 -0.01 ⬇️
tests/visitors/test_base.py 9.48 9.5 0.02 ⬆️
tests/visitors/test_core.py N/A 9.73 N/A

Here are some functions in these files that still need a tune-up:

File Function Quality Recommendation
django_codemod/visitors/base.py BaseSimpleRenameTransformer.leave_ImportFrom 5.75 Split out functionality

Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Let us know what you think of it via email or our Gitter!

@codecov
Copy link

codecov bot commented Jul 16, 2020

Codecov Report

Merging #123 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #123   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        18    +1     
  Lines          455       476   +21     
=========================================
+ Hits           455       476   +21     
Impacted Files Coverage Δ
django_codemod/visitors/__init__.py 100.00% <100.00%> (ø)
django_codemod/visitors/base.py 100.00% <100.00%> (ø)
django_codemod/visitors/core.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 9e7c1e3...d6c7ea0. Read the comment docs.

@browniebroke browniebroke merged commit eef8490 into browniebroke:master Jul 20, 2020
@browniebroke
Copy link
Owner

Thank you for this improvement! 🎉

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

Successfully merging this pull request may close these issues.

2 participants