Skip to content

clang-format behaves differently on pipe than with explicit path #81118

@emilyyyylime

Description

@emilyyyylime

Previous discussions: clangd/clangd#1926, helix-editor/helix#9563

To reproduce:

$ touch .clang-format
$ printf '#include "a.hpp"\n#include "b.hpp"\n' > b.cpp
$ clang-format --style=file b.cpp
#include "b.hpp"
#include "a.hpp"
$ cat b.cpp | clang-format --style=file
#include "a.hpp"
#include "b.hpp"

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang-formatquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions