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

Fixers don't work for Mako and Jinja2 in edge case #118

Closed
koxudaxi opened this issue May 20, 2020 · 1 comment
Closed

Fixers don't work for Mako and Jinja2 in edge case #118

koxudaxi opened this issue May 20, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@koxudaxi
Copy link
Contributor

Thank you for creating a great plugin.

Describe the bug
JinjaAutoInspectFixer and MakoFilter don't work correctly in this case.

To Reproduce
I fixed Environment and Template in this code with fixers
Before:

from mako.template import Template
from jinja2 import Environment, PackageLoader 

Environment(loader=PackageLoader(package_path='yourapplication',package_name='templates'))
Template(str(value='abc'))

After:

from mako.template import Template
from jinja2 import Environment, PackageLoader 

Environment(loader=PackageLoader(package_path='yourapplication', package_name='templates', autoescape=True))
Template(str(value='abc', default_filters=['h']))

If an argument has keyword arguments then, Fixers insert an argument to nested argument.
the arguments have to be a top-level arguments

Screenshots
Peek 2020-05-21 02-23

Additional context

  • Plugin Version 1.18.0
  • PyCharm Pro 2020.1.1
  • Python Version 3.8.0
@koxudaxi koxudaxi added the bug Something isn't working label May 20, 2020
@tonybaloney
Copy link
Owner

Fix works really well, thanks for the detailed report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants