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

Determine file type from --stdin-filename #2167

Closed
bryanforbes opened this issue Apr 29, 2021 · 1 comment · Fixed by #2169
Closed

Determine file type from --stdin-filename #2167

bryanforbes opened this issue Apr 29, 2021 · 1 comment · Fixed by #2169
Labels
C: configuration CLI and configuration S: accepted The changes in this design / enhancement issue have been accepted and can be implemented T: enhancement New feature or request

Comments

@bryanforbes
Copy link
Contributor

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

Currently, black ignores the filename passed to --stdin-filename to determine if it is a python file or stub file for formatting. This is frustrating for me because I have to set up a separate file type for python stub files to use coc.nvim + coc-diagnostic in order to use a different command line invocation (adding --pyi) to process stub files.

Describe the solution you'd like

When black is invoked with --stdin-filename, it should set the is_pyi flag on the Mode like what is done at the beginning of format_file_in_place().

@bryanforbes bryanforbes added the T: enhancement New feature or request label Apr 29, 2021
@JelleZijlstra
Copy link
Collaborator

Reasonable idea, feel free to submit a PR!

@ichard26 ichard26 added S: accepted The changes in this design / enhancement issue have been accepted and can be implemented C: configuration CLI and configuration labels Apr 29, 2021
bryanforbes added a commit to bryanforbes/black that referenced this issue Apr 29, 2021
bryanforbes added a commit to bryanforbes/black that referenced this issue Apr 29, 2021
bryanforbes added a commit to bryanforbes/black that referenced this issue Apr 29, 2021
@ambv ambv closed this as completed in #2169 May 2, 2021
ambv pushed a commit that referenced this issue May 2, 2021
Fixes #2167

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: configuration CLI and configuration S: accepted The changes in this design / enhancement issue have been accepted and can be implemented T: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants