vigo / textmate2-python-fmt

Python FMT is a python linter/formatter/checker for TextMate.
MIT License
13 stars 5 forks source link

Can not use black options #6

Closed moonso closed 3 years ago

moonso commented 4 years ago

Hi, I can not figure out how to use black options for fmt, in specific I want to use line-length 100. In my project I have a pyproject.toml with a entry like:

[tool.black]
line-length = 100

So when I run the cli of black on the command line everything works as expected:

$ which black
/Users/mansmagnusson/.local/share/virtualenvs/cg-a7qqXvqd/bin/black
$ black path/to/file.py

However when using fmt the pyproject.toml option is ignored. I have tried to add the option in my .tm_properties as well without success:

TM_PYTHON_FMT_BLACK="/Users/mansmagnusson/.local/share/virtualenvs/cg-a7qqXvqd/bin/black"
TM_PYTHON_FMT_BLACK_DEFAULTS = "line-length=100"

Do you have any clue @vigo ?

Thanks for help

vigo commented 3 years ago

Hi @moonso , well, your cli environment and textmate environment are different. i always create .tm_properties file and;

TM_PYTHON_FMT_VIRTUAL_ENV="/Users/vigo/.virtualenvs/MYENV"
TM_PYTHON_FMT_PYTHON_PATH="${TM_PYTHON_FMT_VIRTUAL_ENV}/bin/python"
TM_PYTHON_FMT_PYLINTRC="/Users/vigo/Repos/Development/FOO/web_apps/MYPROJECT.pylintrc"

wen need to tell textmate

moonso commented 3 years ago

Thank you!