Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 如何让RuboCop检查以dot开头的文件夹中的文件_Ruby_Rubocop - Fatal编程技术网

Ruby 如何让RuboCop检查以dot开头的文件夹中的文件

Ruby 如何让RuboCop检查以dot开头的文件夹中的文件,ruby,rubocop,Ruby,Rubocop,我想运行存储库。目前,我在存储库中唯一能找到的Ruby文件是 如果我只运行rubocop,它找不到任何文件: $ rubocop Inspecting 0 files 0 files inspected, no offenses detected 我猜它会忽略以点(.docs)开头的文件夹中的文件 RuboCop关于以下内容的文件: 如果您希望它检查其他文件,则需要手动传递 将其添加到中,或在所有COP/Include下为其添加条目 如果我从命令行提供文件的路径,RuboCop会找到该文件:

我想运行存储库。目前,我在存储库中唯一能找到的Ruby文件是

如果我只运行
rubocop
,它找不到任何文件:

$ rubocop
Inspecting 0 files
0 files inspected, no offenses detected
我猜它会忽略以点(
.docs
)开头的文件夹中的文件

RuboCop关于以下内容的文件:

如果您希望它检查其他文件,则需要手动传递 将其添加到中,或在所有COP/Include下为其添加条目

如果我从命令行提供文件的路径,RuboCop会找到该文件:

$ rubocop .docs/CustomTags.rb 
Inspecting 1 file
W
(...)
1 file inspected, 26 offenses detected
$ rubocop
Inspecting 0 files
0 files inspected, no offenses detected
我们的持续集成只是为存储库运行
rubocop
,因此我无法从命令行提供文件的路径。我必须使用
AllCops/Include
,但我不知道怎么做

如果我在存储库的根目录中创建
.rubocop.yml

AllCops:
  Include:
    - '.docs/CustomTags.rb'
并运行Rubocop,但找不到该文件:

$ rubocop .docs/CustomTags.rb 
Inspecting 1 file
W
(...)
1 file inspected, 26 offenses detected
$ rubocop
Inspecting 0 files
0 files inspected, no offenses detected
我尝试了
.rubocop.yml
文件的几种变体,包括:

AllCops:
  Include:
    - '**/CustomTags.rb'


但是他们都没有找到这个文件。

这是一个错误。它现在已经修复,但带有该修复的gem尚未发布。

这里也有报道:看起来它是在Rubocop版本0.27.1中修复的。