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

Django session codemod to use codemod API #125

Merged
merged 2 commits into from
Nov 20, 2023
Merged

Conversation

clavedeluna
Copy link
Contributor

Overview

Rely on codemod API

Cleaner django session codemod and refactor

Copy link

codecov bot commented Nov 9, 2023

Codecov Report

Merging #125 (f4ef13c) into main (cded591) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #125      +/-   ##
==========================================
- Coverage   96.33%   96.32%   -0.02%     
==========================================
  Files          66       66              
  Lines        2732     2718      -14     
==========================================
- Hits         2632     2618      -14     
  Misses        100      100              
Files Coverage Δ
src/codemodder/codemods/base_codemod.py 100.00% <100.00%> (ø)
src/codemodder/codemods/utils.py 93.67% <100.00%> (+0.16%) ⬆️
.../core_codemods/django_session_cookie_secure_off.py 97.61% <100.00%> (-0.69%) ⬇️

@@ -91,3 +91,10 @@ def get_function_name_node(call: cst.Call) -> Optional[cst.Name]:
case cst.Attribute():
return call.func.attr
return None


def is_assigned_to_True(original_node: cst.Assign):
Copy link
Contributor

Choose a reason for hiding this comment

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

To make this more general, it should cover the AnnAssign (assign with annotations, e.g. x:int=1) case. Just note that AnnAssign may not always have a non-None target attribute.

@clavedeluna clavedeluna added this pull request to the merge queue Nov 20, 2023
Merged via the queue into main with commit 9054ace Nov 20, 2023
@clavedeluna clavedeluna deleted the use-api-django-ses branch November 20, 2023 12:02
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