草庐IT

ruby-on-rails - 基于本地或 CircleCI 的不同 Rubocop 结果

我刚刚开始在我的RubyonRails项目中使用Rubocop,并创建了一个git分支来重构并让Rubocop跟上我想要的速度。终于在运行命令的时候无罪$rubocop但是,我试图将Rubocop集成到我的CircleCI构建中,这就是我遇到麻烦的地方。这是我的circle.yml文件的相关部分:test:post:-bundleexecrubocop问题是,本地Rubocop说它正在检查68个文件,但在CircleCI上它说它正在检查5624个文件。因此它没有通过。什么会导致我在本地运行与在CircleCI上运行时得到不同的输出?此外,如果我运行:bundleexecrubocop在

ruby - 如何解决 Rubocop respond_to_missing?罪行

Rubocop给我以下罪行lib/daru/vector.rb:1182:5:C:Style/MethodMissing:Whenusingmethod_missing,definerespond_to_missing?andfallbackonsuper.defmethod_missing(name,*args,&block)...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^缺少的方法定义为:defmethod_missing(name,*args,&block)ifnam

ruby - vscode( vscode-ruby + rubocop ) 如何在保存时自动更正?

环境vscode版本1.19.1(1.19.1)鲁博科普(0.52.1)Darwinmbp16.7.0Darwin内核版本16.7.0:2017年10月4日星期三00:17:00PDT;root:xnu-3789.71.6~1/RELEASE_X86_64x86_64ruby2.3.5p376(2017-09-14修订版59905)[x86_64-darwin16]已关注https://github.com/rubyide/vscode-ruby#linters并安装所有gem并像这样编辑settings.json。{"ruby.rubocop.executePath":"/Users

ruby - 如何修复 a::b::c 类的 rubocop 攻击

我有以下文件lib/a/b/c.rbclassa::b::cdefrequest(env)#somecodehereendend现在我正在使用rubocop风格Style/ClassAndModuleChildren:Enabled:true我为此受到了rubocop的攻击lib/a/b/c.rb:1:7:C:Usenestedmodule/classdefinitionsinsteadofcompactstyle.classa::b::c当我更新我的代码以修复以下问题时样式一classaclassbclasscdefrequest(env)#somecodehereendendend