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

Fix enable-jinja2-autoescape when kwargs can't be known #397

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

drdavella
Copy link
Member

Overview

Fix enable-jinja2-autoescape when kwargs can't be known

Description

  • Handle case where contents of **kwargs can't be known
  • If we add autoescape in this case and it's already present in kwargs then we are going to break the code

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

expexted_output
) = """
import jinja2
env = jinja2.Environment(**kwargs)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would've thought a more telling test case would be
env = jinja2.Environment(**{"autoescape": True}) but I think it will trigger in all cases.

@drdavella drdavella added this pull request to the merge queue Mar 20, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 20, 2024
@drdavella drdavella added this pull request to the merge queue Mar 20, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 20, 2024
@drdavella drdavella added this pull request to the merge queue Mar 20, 2024
Merged via the queue into main with commit 86fafcd Mar 20, 2024
13 checks passed
@drdavella drdavella deleted the fix-autoescape-kwargs branch March 20, 2024 15:03
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