<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/71732>71732</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-tidy: llvm-header-guard adds absolute path to header guard
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-tidy
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
vadymchan
</td>
</tr>
</table>
<pre>
I encountered an issue with the `llvm-header-guard` check when running Clang-Tidy through the Visual Studio extension - Clang Power Tools. It refactors header guards using absolute paths:
```cpp
#ifndef C:_USERS_VADYM_SOURCE_REPOS_PET_PROJECT_MATH_LIBRARY_SRC_LIB_OPTIONS_OPTIONS_H
#define C:_USERS_VADYM_SOURCE_REPOS_PET_PROJECT_MATH_LIBRARY_SRC_LIB_OPTIONS_OPTIONS_H
```
This behavior isn't ideal. I'm looking for a guard style that reflects the project structure, such as:
```cpp
#ifndef MATH_LIBRARY_OPTIONS_H
#define MATH_LIBRARY_OPTIONS_H
```
, where MATH_LIBRARY_ is project name and OPTIONS_H is file name (it's in ideal case, but at least the header guard should be file name - OPTIONS_H). Is there a way to customize `llvm-header-guard` to generate project-based, rather than absolute path-based, guards?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0lN-P4jYQx_8a52UEShyWLA954FjQUfUKAu6ke4om8RC7Z2zkH0vpX18l2bLQaqu-nIRwEtvf8fcz40HvVWuISvb0iT29JBiDtK58RXE9NRJNUltxLddAprHRBHIkAA0o7yPBRQUJQRKwaar162kkCQW5URvRCTZNoZHU_ICLJAMuGqNMCwuNph0dlLhCkM7GdlD4pnxEDfsQhbJAfwQyXlkDo2EDbO2FHBys1X4M6wCOjtgE6zwMMaGP6SH6LgjW3uoYCM4YpGf5nKUvLJ2zaTr8mvP57QvP1dEIOsKC5fPq636521ff5i_fv1T7zdfdYlntltvNvtouD9V2t_lluThUX-aHz9Wv60-7-e57td8tuudqsz2sN7_tb-Pnm76gozL0s_T_djS8HqTyUJPEV2UdKG8YLwIoQajHsGa8OIG29keH6Ggd4EANfLhqgiCx56qpCb5PytnZ36kJ4IOLTYiOGF-Aj40E_H9QH6x8iOY_Vz0a7A5wkeT-sQmUvx3W4IkAjYCbUjd7VJqGKcafVWC88KDMgAYa9L21OgbAAJrQhx7AfW2BlzZqATXdiY3eozA-G8O6B-cIEC54hWChiT7Yk_rz40sSLLRkyGG4ER_V6El0R3LY6XW5MY9V_b5kqHyWr94Q3f0noszFLJ9hQmU2nc0mxWSWFoksixpnz1mdP2H2jEVWEBXpRKR1TlNeEz8mquQpz7MsfeYpzybFOM9nU45TIZqMC8qObJLSCZUed57G1rVJ3xPKIitynmisSfu-qXDe9Fc-KHFlnHdNxpU9iDq2nk1SrXzw7zJBBU3l3Z58Dv_iBiiEfwTScbzPVxKdLmUI575U-YrxVauCjPW4sSfGV53m2zB6w874qjfhGV_1Pv4KAAD__00OpYQ">