<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64301>64301</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Create NOLINT directive that covers a range of lines
</td>
</tr>
<tr>
<th>Labels</th>
<td>
enhancement,
clang-tidy
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
carlosgalvezp
</td>
</tr>
</table>
<pre>
Currently it's a bit cumbersome to introduce a NOLINT suppression for template code. The following solutions are a bit ugly:
```cpp
template <typename T>
class Foo : public SomeLongThing // NOLINT -> makes the line too long
{};
```
```cpp
template <typename T>
// NOLINTNEXTLINE -> creates a "sandwitch" between lines
class Foo : public SomeLongThing
{};
```
```cpp
// NOLINTBEGIN
template <typename T>
class Foo : public SomeLongThing
// NOLINTEND -> creates similarly a sandwitch, and pollutes the code a bit
{};
```
It would be good to have for example a new `NOLINTNEXTLINES` directive like this:
```cpp
// NOLINTNEXTLINES 2
template <typename T>
class Foo : public SomeLongThing
{};
```
This says "apply the NOLINT suppression to the following 2 lines".
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVE2PmzwQ_jXmMkpkDEnIgcPm61WkVd7D5tDrYCbgrrGRbZLSX19Bst2mXWm32koIJI-Yeb7G6L2qDFHOZis220TYhdq6XKLT1leoz_S9jQpb9vm6c45M0D2owMTCA0KhAsiuKch52xAEC8oEZ8tOEiAc_n_cH47gu7Z15L2yBk7WQaCm1RgIpC1pCsea4GS1thdlKvBWd0FZ4wEd3SZ0le5Z8sD4hvGX95xfH9m215OfXVmyDn1LBhuCI0u2cK1Ljd7DzlpgyQO0XaGVhCfb0KM11bEeZgMTOyZ2L7gnw88NPpOHUBNoZQaGFrQ11Q3FYsUWG5asfgP1OaR3KA7bL8fH_WF7RSMdYaBBeSaER1NeVJA1EwIKChciM6L0f8H4EzzucK62_-0P_9CJPydsD5t7EbxqlEane0D4RYs1oCmhtVp34WbdELRrlj7Odx_gYjtdQkFQWVsO4a7xTGOE6Rs2rR56GroAm_N7s57YnEOpHMmgzkNynglCrfy7IX7T-icQ7wj7YV0_Tv9YKw8eez8kDdtW96OSb6x0sGPldYXFLYRCTKMyT8plssSI8ni-5FkWp8s0qnOxOCXIeVKIdEYUL1DGMxKnebYoeZbiLFK54CLhGY_5Ms7idIpYLGZlhjwt8CTKOUs5Naj0VOtzM7WuipT3HeXzNOFxpLEg7cc7TQgyNRpJDZnAhGBizYSQGk01Carsh6PZJnL50GhSdJVnKdfKB__aOqigKV-PwXvR4NXfUGMAac_khs10aCoCe7qqEHVO53UI7Wj-aG-lQt0VU2kbJnbDiNtn0jr7lWRgYjdS8UzsRjY_AgAA__9PhbYB">