Skip to content

[clang-format] .clang-format-ignore ignores -assume-filename option #113099

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

Closed
kakkoko opened this issue Oct 20, 2024 · 1 comment · Fixed by #113100
Closed

[clang-format] .clang-format-ignore ignores -assume-filename option #113099

kakkoko opened this issue Oct 20, 2024 · 1 comment · Fixed by #113100

Comments

@kakkoko
Copy link
Contributor

kakkoko commented Oct 20, 2024

The filename given by the -assume-filename option is used to search for .clang-format files, etc., but is not used to match the contents of the .clang-format-ignore file.

For example, the C/C++ extension of VSCode uses the -assume-filename option to provide a filename, and the content to be formatted is provided from standard input. Therefore, the .clang-format-ignore file will not work for that extension.

@kakkoko
Copy link
Contributor Author

kakkoko commented Oct 21, 2024

If "ignore" is implemented as "do not output anything," the formatting result will be empty (and the C/C++ extension interprets the formatting as a failure), so appropriate processing such as outputting standard input directly to standard output is necessary.

Edited: what I wrote above was incorrect. The extension will work properly even if it outputs nothing.

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

Successfully merging a pull request may close this issue.

1 participant