This is to allow format document feature in VSCode to format the file using 2 spaces instead of 4.
https://stackoverflow.com/questions/54430470/vs-code-python-autopep8-does-not-honor-2-spaces-hanging-indentation https://stackoverflow.com/a/70932095
- Navigate to library directory of your environment
- Open autopep8.py
- Search for "DEFAULT_INDENT_SIZE" and change it to 2
If using minioconda, autopep8.py file can be found in the location as below
- miniconda3/envs/ENVNAME/lib/python3.10/site-packages/autopep8.py
In case of anaconda, this will probably be
- anaconda3/envs/ENVNAME/lib/python3.10/site-packages/autopep8.py
Additionally, E121 can be added in the ignore list in the autopep8.py