2

I want to automatically insert white space around '=' in a keyword argument,

eg. through a config option in "python.formatting.autopep8Args": [......] in settings.json.

The goal is to automatically fix the E225:missing whitespace around operator.

For example, I want to transform Users.objects.get(id=userId) to Users.objects.get(id = userId)

How can I achieve this?

Ajay
  • 61
  • 6
  • Anyways, I doubt autopep8 will have a config option for that, because [it breaks PEP8 recommendations](https://peps.python.org/pep-0008/#other-recommendations) – SuperStormer Sep 27 '22 at 05:14
  • What linter is giving the "E225:missing whitespace around operator"? (flake8?) What's its version? – SuperStormer Sep 27 '22 at 05:18
  • It just doesn't seem to add spaces to the brackets from around the equals sign. Without parentheses, formatting the document would add spaces around the equal sign. – JialeDu Sep 30 '22 at 09:22

0 Answers0