@@ -85,20 +85,27 @@ line_is_in_changed_range() {
8585 target_line=" $1 "
8686 file=" $2 "
8787
88+ echo " 🔍 DEBUG: Verificando se linha $target_line do arquivo $file esta alterada"
8889 generate_git_diff " $file " > " $FILE_DIFF "
90+ echo " 🔍 DEBUG: Diff gerado:"
91+ cat " $FILE_DIFF "
8992
9093 while read -r diff_line; do
9194 if echo " $diff_line " | grep -q " ^@@" ; then
95+ echo " 🔍 DEBUG: Processando linha diff: $diff_line "
9296 range_info=$( parse_diff_range " $diff_line " )
9397 start=$( echo " $range_info " | cut -d' ' -f1)
9498 count=$( echo " $range_info " | cut -d' ' -f2)
99+ echo " 🔍 DEBUG: Range: start=$start count=$count , verificando linha $target_line "
95100
96101 if [ " $target_line " -ge " $start " ] && [ " $target_line " -lt " $(( start + count)) " ]; then
102+ echo " 🔍 DEBUG: MATCH! Linha $target_line esta no range $start -$(( start + count - 1 )) "
97103 return 0
98104 fi
99105 fi
100106 done < " $FILE_DIFF "
101107
108+ echo " 🔍 DEBUG: Linha $target_line NAO esta em nenhum range alterado"
102109 return 1
103110}
104111
@@ -120,14 +127,19 @@ check_blocking_rules() {
120127
121128 grep -E ' :[0-9]+:' " $CODENARC_RESULT " | while IFS=: read -r file line rest; do
122129 [ -z " $file " ] && continue
130+ echo " 🔍 DEBUG: Analisando violacao $file :$line "
123131
124132 if ! file_matches_patterns " $file " " $allowed_patterns " ; then
133+ echo " 🔍 DEBUG: Arquivo $file nao corresponde aos padroes"
125134 continue
126135 fi
136+ echo " 🔍 DEBUG: Arquivo $file corresponde aos padroes"
127137
128138 if line_is_in_changed_range " $line " " $file " ; then
129139 echo " 🚨 Violacao P1 em linha alterada: $file :$line "
130140 echo " 1" > " $VIOLATIONS_FLAG "
141+ else
142+ echo " 🔍 DEBUG: Linha $line nao esta no range alterado"
131143 fi
132144 done
133145
0 commit comments