<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/77341>77341</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-tidy fails to parse config files silently, even with --verify-config.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-tidy
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
knjmooney
</td>
</tr>
</table>
<pre>
If you have an invalid clang-tidy config file, clang-tidy carries on silently and uses the default configuration settings. I've encountered this in several projects where there is a typo in the clang-tidy config file, which results in the default config being used.
With verify-config, the errors are reported, but it eventually claims "No config error detected" and sets a successful exit code.
```
-> clang-tidy-17 --version
Ubuntu LLVM version 17.0.4
Optimized build.
-> echo "This is not a valid clang-tidy file" > .clang-tidy
-> clang-tidy-17 --verify-config && echo PASSED || echo FAILED
/tmp/test/.clang-tidy:1:1: error: not a mapping
This is not a valid clang-tidy file
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error parsing /tmp/test/.clang-tidy: Invalid argument
/tmp/test/.clang-tidy:1:1: error: not a mapping
This is not a valid clang-tidy file
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error parsing /tmp/test/.clang-tidy: Invalid argument
No config errors detected.
PASSED
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcVEuTozYQ_jXi0mUKBAbPgcNkZlw1VZNH1eZxFtCANkKi1C1PnEN-e0rA7Ho2j805LhvbUj--71PrU0R6tIiNOH4jjo-JCjw53_xqP87OWbwmreuvzfMAVxdgUhcEZUHbizK6h84oOx5Y91fonB30CIM2KOTDux3lvUYCZ4G0QcvmCsr2EAgJeELocVDB8F4ieMU6xiKztiOl8CxkfUFA27lgGT32wJMm0DHogl4ZWLz7iB0TvE7oMVb1CJpAAV8XFyNjo3-G-zrpbgKPFAzTW_h7XNCitmNE3aciexTZ_fb8RfMEF_R6uB62yFgw5qP3zhMoj-BxcZ6xj1ttYNAMeEHLQRlzjbj0TCCk_M69dVuToUfGbs2Tq2aEHElR6DokGoIB_E1HhD2-AyWqbH-vf-Egiqcb-oe8hsPhgp6i0lvMT22wHODl5edv4W0nr9MsLfca8P3Ceta_Yw9t0Oa9ClsH7CYXafy4Hg-BdQwK_jIrm-oSYkp6s76X-grmz0KDkJWQ1db2h_sPH54eQdQPon7Yls73zy9PjztMeeZ5iU8kFvJ801cU9_n-2WSPPzbos1oWbcetxH9htfU6Pv3x1dcW-rQe86I8xeH6d5DwvF875ccwo-X_O7MvbgN9ug776G1H_rcTn_RN0d8VdyrBJq-zsi5kfXdKpqYaTlkxoCpUlQ9tJkulsgpV3R5PRZ_JKtGNzGSZ5dkpr45FfkpPssC-PSpZlXWXl4MoM5yVNqkxlzl1fkw0UcCmrosyT4xq0dDqplLekJQyuqtvYtKhDSOJMjOamD6XYc0Gm1vdlTYE7FYV8daz6JOVRkeJVgKv0Ye-uCBpErxpJuaFRBEHRcjzqHkKbdq5Wchz7L1_HXYPFfK88iEhzyulPwMAAP__CPEHjA">