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

Request for a mechanism to accept more target files than the platform line length will allow #3480

Open
mkillianey opened this issue Jan 4, 2023 · 0 comments
Labels
T: enhancement New feature or request

Comments

@mkillianey
Copy link

mkillianey commented Jan 4, 2023

Is your feature request related to a problem? Please describe.

When using black to format long lists of files, one must use a tool like xargs to avoid triggering the platform's maximum command-line length. For example, if I want to clean up the modified files in my workspace, I can't write this:

black $(git status --porcelain | cut -c3- | grep -e '*.py$')

Because the command-line would overflow. Instead, I have to write it this way, triggering black multiple times:

$(git status --porcelain | cut -c3- | grep -e '*.py$') | xargs black

(Yes, yes, I know that's not properly escaping the filenames...the point here is just that black is triggered multiple times, rather than once.)

Describe the solution you'd like

I would love some syntax to pass more files to black than will fit on my platform's command-line, perhaps similar to the way git add works, in that if this is in danger of overflowing:

git add -- $(command that generates many files)

It can be replaced by a single invocation:

$(command that generates many files) | git add --pathspecs-from-file=-

Describe alternatives you've considered

Using xargs to invoke black multiple times.

@mkillianey mkillianey added the T: enhancement New feature or request label Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant