File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -488,7 +488,14 @@ func hasLicense(b []byte) bool {
488
488
if len (b ) < 1000 {
489
489
n = len (b )
490
490
}
491
- return bytes .Contains (bytes .ToLower (b [:n ]), []byte ("copyright" )) ||
492
- bytes .Contains (bytes .ToLower (b [:n ]), []byte ("mozilla public" )) ||
493
- bytes .Contains (bytes .ToLower (b [:n ]), []byte ("spdx-license-identifier" ))
491
+ // Convert to lowercase for case-insensitive matching
492
+ content := bytes .ToLower (b [:n ])
493
+
494
+ // Check for different variations of copyright/license headers
495
+ return bytes .Contains (content , []byte ("copyright" )) ||
496
+ bytes .Contains (content , []byte ("copyright (c)" )) ||
497
+ bytes .Contains (content , []byte ("the opentofu authors" )) ||
498
+ bytes .Contains (content , []byte ("hashicorp, inc." )) ||
499
+ bytes .Contains (content , []byte ("mozilla public" )) ||
500
+ bytes .Contains (content , []byte ("spdx-license-identifier" ))
494
501
}
You can’t perform that action at this time.
0 commit comments