<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/104034>104034</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-tidy][request] Add possibility to check if function prefix matches the file/module name
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-tidy
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
TheColector
</td>
</tr>
</table>
<pre>
Having the above implemented, clang-tidy should report following statuses after analyzing file called Ethernet.c:
- no error when all public functions have prefix Ethernet_ (like Ethernet_Init, Ethernet_Send, ...)
- error if the public function prefix is different than Ethernet_ (like Init_Ethernet, InitEthernet, SendData, ...)
In case of private functions that start with keyword **static**, there could also be a case to handle that.
I'm curious how much effort that would require to implement it, and whether other ppl would consider this feature as something helpful.
I know from experience that the tools currently in existence lack this feature and it for sure be considered as something valuable for all those who want to keep their repository inlined with their coding standard who would be able to catch this (at least to some extent)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxslM-S4jgMxp_GXFRNBRMGOOTQMyy1fd69Tym2gr04VtZWSLNPv-WE_jNdcwnEsfX9JH0W5uwvkahRu-9qd1rhKI5T87ejHxzICKdVy_be_Ik3Hy8gjgBbvhH4fgjUUxSySv8AEzBensTbO2THY7CQaOAk0HEIPJWzWVDGTBmwE0qAEcP9v_Kh84HAYAhk4Q9xlCLJ2qjts6pOqnp-gshAKXGCyVEEDAGGsQ3eQDdGI55jBoc3giFR51_fY_wEpQ_BX-lj5SV6KbjvC39RnPnX67XSxzfBRc13c75ftN5UfAbru44SRQFxGH-jW-R-vi0XmbLw-b3In1DwK8LyfIlgMBNwB0PyNxT6lLE4lFLTJDB5cXCl-8TJgtLPSj-XYnuz_C_BiyaBmTuDITO0BLhEFwaH0QaaQ65_AVB634MZk-cxg-MJ-tE4oK4rrZ0Jpkez_x19mmO9GwOWUmO0pW8FAHh-DkN4HDMcs7eUQJzP0BHKmAgwQ-aexBVzOApDN4YH1gtcI0_QJe6BXgdKnqJZwOdeCXPIBbh0JdzBR6BXn2XeFdBcvyhFC754NEEu7y29I5H9leOGYcQ20Ly5WFAcZ4LJMUxYHMBwJRoKhU-z-bMXTgUh-Eh2adLy1bB9XIhoMdklyFyQ0pUiIgwGxbgFV-kDCgTCPOsUKKBXoShKH1e22drj9ograjZ7vf1W77_VeuWaQ3081HigDWFb13av9Z66AyFW7b6qcLfyja50XR029WZXVfVmvbWH9ljVB1tvdtRVO1VX1KMP6xBu_ZrTZeVzHqnZVHW1rVcBWwp5nhxafwwApXWZJKkpp57a8ZJVXQWfJX_EES9hnjmfju1Oave9GImyqN0Jnq2FgXP2rQ9e7nNNHJlruZdfL2NfikV59kAZJ0qfe7ZjIIjY02pMoXEiQy5DRZ-VPl-8uLFdG-6VPhesx8_TkPgfMqL0ec41K31-pHtr9P8BAAD__2H8yYw">