this Bash solution didn't work for me, on account of a multi-level project structure that i was dealing with. (at least, i think it was multi-level.)
What did work for me was something akin to the following:
qmake ./my_project.pro -spec linux-clang CONFIG+=release CONFIG+=DISABLE_DEVELOPER_MODULES CONFIG+=force_debug_info && /usr/bin/make qmake_all
make -j $CORES VERBOSE=y all &>make_output.txt
compiledb --parse make_output.txt
mkdir build/yamls
run-clang-tidy -p . -j $CORES -clang-tidy-binary $CLANG_TIDY_PATH -checks=-*,bugprone-*,clang-*,cppcoreguidelines-*,modernize-* -export-fixes build/yamls
this gives me a bunch of moc_* complaints, but also complaints on my actual code. the moc_* complaints seem to be clang-tidy's complaints about Qt itself, so i filter those out.