<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/54354>54354</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format gives wonky indentation
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
epixinvites
</td>
</tr>
</table>
<pre>
`clang-format version 13.0.1`
clang-format options -> https://termbin.com/n7gx
So, my problem here is that whenever I format a piece of code, similar to the below
```cpp
std::vector<std::tuple<int, int, int>> input { // Node a, node b, weightage
{1, 2, 5},
{1, 3, 3},
{1, 4, 7},
{2, 4, 3},
{2, 5, 2},
{3, 4, 1},
{4, 5, 2}
};
```
clang-format gives me some wretched output like this
```cpp
std::vector<std::tuple<int, int, int>> input {
// Node a, node b, weightage
{1, 2, 5},
{1, 3, 3},
{1, 4, 7},
{2, 4, 3},
{2, 5, 2},
{3, 4, 1},
{4, 5, 2}
};
```
A horrendous mixture of tabs and spaces and the comments behind are somehow thrown to the next line with 0 indentation.
Is it something to do with my wrongly configured clang-format? If so, please help me point out what I have to change in order to achieve the formatting on the first code block.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytVE2ToyAQ_TV66RoLRZPJwUPmqyqXvewvQO0oOwgWYEz-_TaazGY2yW0sC5BHf-DrfpVpTmW0YrUSun3aG9sLDwe0ThoNKU9YkhIasbeIbb-dMYOnIw6eIv4OnfeDi_g2yj7o9Wj7SuqkNj196XV7XOyX8beJslfoTzBYUynsoUOLIB34jtxOHWqk-LCDcyABg8QaweyhNg0GYyd7qYQFb8gIoUJlpnMIynV-62FYdpxvQmJ8e8DaGxvx168dPw4KaUNqH7xeTfw93ErqYfQQrV8itlluBr8oAxDhmA6rKqwmlG3nRYuXW27IJA1IFoYiWr_RfAPyZbgP5mFY34LZF3jH8hxuDnwD8i_L9BbMv1suCC34y3-_9U4htPKADnoEZ2iYLPq6wwbM6MPfU_ITiSTpHvFDCfwMRcEZwA_xBPQ8JuoavWXqjD6g6hq95eqMPiDrjN5ja4EeMraFzliLujEjcSWPfrRzR3lRORC6ATeIGpdlaClq3R61d9RbnaQ9YRd-OzMRbs2kL82n8RhY1kS99B0woqQhSxHUIbnu-50D6WcnVA66DfaNWYxIDCZrdKtOFFjvZUvZNXBdZRH_gN2erMOtqSSEQ9INNYS6GwzVQ6g3Eg-qxx104oDBfd2RA5IWDcY2OMuFqDuJAaXMF88-5EJaN-9I6_ysMlApU38mcVPyZsM3IvbSKyzvFP5k9Ofp-tLxaFX5XRBbuuRYnfVQqcNleiIJ_EM1T5_SuREdLYqcF3nclXzP1lXaiA3Ls02Vr_gzq9JVxqqCrYtcsFgJ0j1XRsVLVLzFssxYljGeZmmRZfkmSUXK1-vnoklXNSvSVZQz7IVUSQicGNvGtpxzqMbWEaik8-4fKJyTrUa8-BejpwoqcZBHqQ_So4vnlMs537-cXM55">