File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,9 @@ type Reasons struct {
5656type StringsModifyFilterer struct {}
5757
5858func (s StringsModifyFilterer ) Filter (file * gitdiff.File ) * Reasons {
59+
60+ total := 0
61+ stringModiry := 0
5962 for _ , fragments := range file .TextFragments {
6063 for i , line := range fragments .Lines {
6164 if line .Op != gitdiff .OpAdd {
@@ -74,14 +77,18 @@ func (s StringsModifyFilterer) Filter(file *gitdiff.File) *Reasons {
7477 continue
7578 }
7679
80+ total ++
7781 if strings .ContainsAny (diffs [0 ].Text , `"'` ) && strings .ContainsAny (diffs [2 ].Text , `"'` ) {
78- return & Reasons {
79- File : file .NewName ,
80- Message : "only string modified" ,
81- }
82+ stringModiry ++
8283 }
8384 }
8485 }
86+ if total != 0 && total == stringModiry {
87+ return & Reasons {
88+ File : file .NewName ,
89+ Message : "only string modified" ,
90+ }
91+ }
8592 return nil
8693}
8794
You can’t perform that action at this time.
0 commit comments