How to get the beautiful pio check output also when running clang-tidy?

If I run pio check, I have an output like this:

src/main.cpp:10: [medium:warning] inclusion of deprecated C++ header 'stdlib.h'; consider using 'cstdlib' instead  [hicpp-deprecated-headers,modernize-deprecated-headers]
src/main.cpp:16: [medium:warning] declaration must be declared within the '__llvm_libc' namespace  [llvmlibc-implementation-in-namespace]
src/main.cpp:19: [medium:warning] declaration must be declared within the '__llvm_libc' namespace  [llvmlibc-implementation-in-namespace]

whereas if I run clang-tidy src/main.cpp I have an output like this:

/Users/ubaldot/.platformio/packages/toolchain-atmelavr/bin/../lib/gcc/avr/7.3.0/../../../../avr/include/stdlib.h:48:10: error: 'stddef.h' file not found [clang-diagnostic-error]
#include <stddef.h>
         ^~~~~~~~~~
/Users/ubaldot/Documents/arduino/freeRTOS/hello_world/src/main.cpp:10:10: warning: inclusion of deprecated C++ header 'stdlib.h'; consider using 'cstdlib' instead [modernize-deprecated-headers]
#include <stdlib.h>
         ^~~~~~~~~~
         <cstdlib>

Are you aware of any flag to pass to clang-tidy to get an output like the one from pio check?

You have to give your clang-tidy invocation a lot more information if it should output the same as in PlatformIO. Particularly, PlatformIO is adding all include directories of the project, the toolchain, optionally the framework, the builtin defines of the toolchain and the project, checking options from the user etc. See here.

You can see the exact invocation that PlatformIO is doing by using PIO CLIpio check -v

C:\Users\Max.platformio\packages\tool-clangtidy\clang-tidy --quiet --checks=* C:\Users\Max\temp\uno_spi_test\src\main.cpp – -DPLATFORMIO=60112 -DARDUINO_AVR_UNO -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO=10808 -D__AVR_ATmega328P__ -D__DBL_MIN_EXP__=(-125) -D__HQ_FBIT__=15 -D__cpp_attributes=200809 […]