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

Black pyi files #308

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Black pyi files #308

wants to merge 2 commits into from

Conversation

Zeckie
Copy link
Contributor

@Zeckie Zeckie commented Oct 18, 2020

Black usually formats pyi files (stubs) differently to how it formats py files. However, due to the way Pydev calls Black, it currently treats both file formats the same.

Update to pass the --pyi switch to Black when formatting a pyi file.

#Hacktoberfest

Comment on lines +71 to +73
//TODO: get black location from config?
black.blackExecutableLocation = System.getenv("LOCALAPPDATA")
+ "\\Programs\\Python\\Python37\\Scripts\\black.exe";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure the best way to get black executable when running unit tests

Copy link
Owner

Choose a reason for hiding this comment

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

This should be based on something from org.python.pydev.core.TestDependent.

The values there are computed when TestDependent is imported.

You can create a file custom for your machine by setting the environment variable "PYDEV_TEST_PLATFORM" to some value -- say: zeckie -- and then create a TestDependent.zeckie.properties file based on the values of one of the existing templates there.

Ideally it should be a new entry there with a default value computed based on the TestDependent.PYTHON_INSTALL (to do that, change the static{} block on TestDependent to fill the value if it wasn't loaded).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants