kezhenxu94 commented on code in PR #263:
URL: https://github.com/apache/skywalking-eyes/pull/263#discussion_r2825378774


##########
commands/header_check.go:
##########
@@ -29,17 +29,28 @@ import (
 )
 
 var CheckCommand = &cobra.Command{
-       Use:     "check",
+       Use:     "check [paths...]",
        Aliases: []string{"c"},
-       Long:    "check command walks the specified paths recursively and 
checks if the specified files have the license header in the config file.",
+       Long: "check command walks the specified paths recursively and checks 
if the " +
+               "specified files have the license header in the config file. " +
+               "Accepts files, directories, and glob patterns. " +
+               "If no paths are specified, checks the current directory " +
+               "recursively as defined in the config file.",
        RunE: func(_ *cobra.Command, args []string) error {
                hasErrors := false
                for _, h := range Config.Headers() {
                        var result header.Result
 
                        if len(args) > 0 {
+                               // Filter args by the paths in this header 
config
+                               var filteredArgs []string
+                               for _, arg := range args {
+                                       if header.MatchPaths(arg, h.Paths) {
+                                               filteredArgs = 
append(filteredArgs, arg)
+                                       }
+                               }

Review Comment:
   Hi, I think when we pass the paths to the CLI args we intend to check that 
files regardless of the config file. The args here should be highest priority 
even if they are not configured in config file



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to