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

pass buffer file name to ‘black --stdin-filename …’ #14

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wbolster
Copy link
Owner

pass the file name (if any) to black via the ‘--stdin-filename’ command line flag. it will be used to discover the project root directory and hence the configuration file (see find_project_root() callers in the black sources), instead of the default behaviour:

If you’re formatting standard input, Black will look for
configuration starting from the current working directory.
https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#where-black-looks-for-the-file

closes #13.

pass the file name (if any) to black via the ‘--stdin-filename’ command
line flag. it will be used to discover the project root directory and
hence the configuration file (see find_project_root() callers in the
black sources), instead of the default behaviour:

> If you’re formatting standard input, Black will look for
> configuration starting from the current working directory.
> – https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#where-black-looks-for-the-file

closes #13.
@wbolster wbolster added the enhancement New feature or request label Nov 29, 2022
@wbolster wbolster self-assigned this Nov 29, 2022
@wbolster
Copy link
Owner Author

@ayys can you give this a try?

@wbolster wbolster marked this pull request as draft November 29, 2022 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run black in specific project directory
1 participant