File tree Expand file tree Collapse file tree 2 files changed +8
-11
lines changed
Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ command line tool (`thriftcheck`).
1010the command line:
1111
1212```
13- usage: thriftcheck [options] [file ...]
13+ usage: thriftcheck [options] [path ...]
1414 -I, --include value
1515 include path (can be specified multiple times)
1616 -c, --config string
@@ -29,8 +29,11 @@ usage: thriftcheck [options] [file ...]
2929 print the version and exit
3030```
3131
32- You can lint from standard input by passing ` - ` as the sole filename. You can
33- also use ` --stdin-name ` to customize the filename used in output messages.
32+ You can pass a list of filenames or directory paths. Directories will be
33+ expanded recursively to include all nested ` .thrift ` files.
34+
35+ You also can lint from standard input by passing ` - ` as the sole filename. You
36+ can also use ` --stdin-name ` to customize the filename used in output messages.
3437
3538``` sh
3639$ thriftlint --stdin-name filename.thrift - < filename.thrift
@@ -43,12 +46,6 @@ file.thrift:1:1: error: "py" namespace must match "^idl\\." (namespace.pattern)
4346file.thrift:3:1: error: unable to find include path for "bar.thrift" (include.path)
4447```
4548
46- You can also directly use the path of a directory to check all the Thrift files within the folder.
47-
48- ``` sh
49- $ thriftlint ./testdata
50- ```
51-
5249If you only want errors (and not warnings) to be reported, you can use the
5350` --errors-only ` command line option.
5451
Original file line number Diff line number Diff line change 8787func init () {
8888 flag .Var (& includes , "I" , "include path (can be specified multiple times)" )
8989 flag .Usage = func () {
90- fmt .Fprintf (flag .CommandLine .Output (), "usage: thriftcheck [options] [file ...]\n " )
90+ fmt .Fprintf (flag .CommandLine .Output (), "usage: thriftcheck [options] [path ...]\n " )
9191 getopt .PrintDefaults ()
9292 }
9393 getopt .Aliases (
@@ -148,7 +148,7 @@ func expandPaths(paths []string) ([]string, error) {
148148 return err
149149 }
150150
151- if ! info .IsDir () {
151+ if ! info .IsDir () && filepath . Ext ( path ) == ".thrift" {
152152 filenames = append (filenames , path )
153153 }
154154
You can’t perform that action at this time.
0 commit comments