@@ -374,18 +374,14 @@ mixin template AnalyzerInfo(string checkName)
374
374
375
375
auto isNoLintUDAForCurrentCheck (in string udaContent, in string check)
376
376
{
377
- import std.algorithm : map;
378
- import std.ascii : toUpper;
379
- import std.conv : to;
380
-
381
- auto re = regex(` \w+` , " gi" );
377
+ auto re = regex(` \w+` , " g" );
382
378
auto matches = matchAll(udaContent, re);
383
379
384
380
if (! matches)
385
381
return false ;
386
382
387
383
const udaName = matches.hit;
388
- if (udaName.map ! (c => c.toUpper).to ! string ! = " NOLINT " )
384
+ if (udaName ! = " nolint " )
389
385
return false ;
390
386
391
387
matches.popFront;
@@ -403,11 +399,10 @@ auto isNoLintUDAForCurrentCheck(in string udaContent, in string check)
403
399
404
400
unittest
405
401
{
406
- const s1 = " NOLINT(abc)" ;
407
- const s2 = " NOLINT(abc, efg, hij)" ;
408
- const s3 = " nolint(abc)" ;
409
- const s4 = " NOLINT ( abc , efg ) " ;
410
- const s5 = " OtherUda(abc)" ;
402
+ const s1 = " nolint(abc)" ;
403
+ const s2 = " nolint(abc, efg, hij)" ;
404
+ const s3 = " nolint ( abc , efg ) " ;
405
+ const s4 = " OtherUda(abc)" ;
411
406
412
407
assert (isNoLintUDAForCurrentCheck(s1, " abc" ));
413
408
assert (! isNoLintUDAForCurrentCheck(s1, " efg" ));
@@ -418,13 +413,10 @@ unittest
418
413
assert (! isNoLintUDAForCurrentCheck(s2, " kel" ));
419
414
420
415
assert (isNoLintUDAForCurrentCheck(s3, " abc" ));
421
- assert (! isNoLintUDAForCurrentCheck(s3, " efg" ));
422
-
423
- assert (isNoLintUDAForCurrentCheck(s4, " abc" ));
424
- assert (isNoLintUDAForCurrentCheck(s4, " efg" ));
425
- assert (! isNoLintUDAForCurrentCheck(s4, " hij" ));
416
+ assert (isNoLintUDAForCurrentCheck(s3, " efg" ));
417
+ assert (! isNoLintUDAForCurrentCheck(s3, " hij" ));
426
418
427
- assert (! isNoLintUDAForCurrentCheck(s5 , " abc" ));
419
+ assert (! isNoLintUDAForCurrentCheck(s4 , " abc" ));
428
420
}
429
421
430
422
@@ -577,7 +569,7 @@ protected:
577
569
return this .errorMsgDisabled == 0 ;
578
570
}
579
571
580
- // Disable error message if declaration contains UDA : @("NOLINT (..)")
572
+ // Disable error message if declaration contains UDA : @("nolint (..)")
581
573
// that indicates to skip linting on this declaration
582
574
// Return wheter the message is actually disabled or not
583
575
bool maybeDisableErrorMessage (const Declaration decl)
0 commit comments