LCOV - code coverage report
Current view: top level - src - match_ignore_pattern.c (source / functions) Coverage Total Hit
Test: coverage.info Lines: 90.0 % 10 9
Test Date: 2026-01-12 05:34:38 Functions: 100.0 % 1 1

            Line data    Source code
       1              : #include "precizer.h"
       2              : 
       3              : /**
       4              :  *
       5              :  * Decide whether or not to ignore the relative
       6              :  * path to the file by comparing it with PCRE2 regular
       7              :  * expressions passed as arguments with --ignore=
       8              :  *
       9              :  */
      10         1400 : Ignore match_ignore_pattern(
      11              :         const char *relative_path,
      12              :         bool       *ignore_showed_once)
      13              : {
      14         1400 :         if(config->ignore == NULL)
      15              :         {
      16              :                 // Nothing to ignore
      17         1138 :                 return(DO_NOT_IGNORE);
      18              :         }
      19              : 
      20          532 :         for(int i = 0; config->ignore[i] != NULL; ++i)
      21              :         {
      22          336 :                 REGEXP result = regexp_match(config->ignore[i],relative_path,ignore_showed_once);
      23              : 
      24          336 :                 if(MATCH == result)
      25              :                 {
      26              :                         // Ignore that file
      27           66 :                         return(IGNORE);
      28              : 
      29          270 :                 } else if(REGEXP_ERROR == result){
      30              : 
      31            0 :                         return(FAIL_REGEXP_IGNORE);
      32              : 
      33              :                 }
      34              :         }
      35              : 
      36              :         // Don't ignore the file
      37          196 :         return(DO_NOT_IGNORE);
      38              : }
        

Generated by: LCOV version 2.0-1