<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/148814>148814</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang-tidy should not guess compile commands
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-tidy
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
t-a-james
</td>
</tr>
</table>
<pre>
If clang-tidy fails to find an entry in the compile commands database it guesses at some flags. For my project (and, I suspect, for any non-trivial project) these flags are always catastrophically wrong. clang-tidy then gives back garbage results.
I would like clang-tidy to simply error out if it's given a compile commands database and a file, but fails to find an entry for the file.
That would be a change in default behaviour. I think the new behaviour would be simpler and less unexpected than the current behaviour, but if that's considered too big a change we could introduce a flag to re-instate the old behaviour, or keep the old default and hide the new behaviour behind a flag.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx8U82OuzYQfxpzGQURB0py4LDdKlLufYEBD-CNsSPPOClvX5nNbrZq-xcHC9nz-5oZZLaTJ-pU87tq_igwyRxiJzvcfeBCXPTBrN1lhMGhn3ZizQojWscgAUbrDaAH8hJXsB5kJhjCcrNuOxf0hsGgYI9MYAWmRMzEgAIcFoLR4cQlwDlEWFa4xfBBg4DSR_RG6Xe4ACe-0SD5ZwwR0K_gg99JtHeL7qtE6VNm5yckYCRA98CVYUBBlhhusx3QuRUeMfiphJ-WZCYPk70TQ4_DFSaMPU4EkTg54VJVb6p6u8AjJGfA2Sv9ozoA2-XmVqAYQ4SQBOwIVpRueYP1gL8IBnOMMFpH2WWf5P8izgHkjPPTp6Y_Z5SnrJ4yy4x-otwMQyMmJ9DTjHcbUiwBLiCz9dcNxNPjdfeC2JxQ3EQ5Yobk6a_cATIgMz6bnGIk_wP7S7gd86NP40PwbA3FXBgC9HZ66XvkHDKj9RKDSUPWnluXTUfaWc-CQhtZ2IT9IAoRrkS378svp1nybA39h72eZvuZssOpLEx3MKfDCQvq9m2jm1bXdVXMndlXZhib_fGABuu2HVocq7E-7Cl_x6qwna50U7X7pjrVVV2V2NJw-O2g9XDSTdsfVV3RgtaVzt2XMsSpsMyJun19PO7rwmFPjrdt0_o1QkrrvH2xy1W7Pk2s6spZFn7hiBVH3ftr7HjeEvThuVf_mrAiRdfNIjdWhzelz0qfJytz6sshLEqfM_Tz2H3v0XnTy0qfn5Lvnf47AAD__5pXb2Q">