rubocop

    2熱度

    4回答

    我想設置我的Rails項目,使所有的貢獻者所需要的驗證是一個命令,目前我們已經在運行: rake test 但現在我們也希望使用rubocop進行靜態分析: rubocop -R -a 我希望這可以在一個簡單的rake任務中執行。如果重寫'rake test'來運行rubocop,然後運行rails項目的標準rake測試工具,那麼很好,因爲沒有人會記得更改命令。但是如果我必須創建一個單獨的

    0熱度

    1回答

    我想爲我的廚師食譜使用lint工具。我目前正在使用foodcritic和rubocop。在使用它們進行靜態代碼分析時,我認爲foodcritic完全專注於廚師食譜,但rubocop主要處理ruby代碼,並且與主廚沒有特別關係。我覺得可能不適用於廚師食譜的幾項rubocop違規行爲。我可以通過將它們放入.rubocop.yml來放棄,但如果這些警察應該被禁用,我不太自信。 是否有任何標準或最可接受的

    0熱度

    1回答

    其實我試圖解決這個問題: 不要使用多個頂級介紹 - 嘗試巢他們。 描述的第一個參數應該是被測試的類或模塊。 我有這種格式的測試計劃八: describe 'PublicanCreatorsCreate.init_docu_work' do it 'accesses a directory and creates there an initial documentation' do

    0熱度

    1回答

    我運行下面的命令: rubocop --require rubocop/formatter/checkstyle_formatter --format RuboCop::Formatter::CheckstyleFormatter --no-color --silent --rails --out checkstyle.xml 而得到這個錯誤: C:/opscode/chefdk/embedd

    5熱度

    2回答

    我有以下代碼 # colours a random cell with a correct colour def colour_random! while true do col, row = rand(columns), rand(rows) cell = self[row,col] if cell.empty? then ce

    4熱度

    2回答

    當我添加一個guard-rspec寶石,並設置Guardfile就象這樣: guard :rspec, cmd: 'bundle exec rspec' do watch('spec/spec_helper.rb') { "spec" } watch('config/routes.rb') { "spec/routing" } watch('ap

    3熱度

    1回答

    我想用Syntastic啓用Rubocop檢查器。我已經設置它有一個檢查器,並給出可執行文件的路徑。雖然:SyntasticInfo報告說它不是活動檢查器。另外:SyntasticCheck rubocop報告rubocop不是可用的檢查器。 我還需要其他設置嗎?這可能是由rubocop --version給出的警告信息引起的嗎? 的.vimrc設置 let g:syntastic_ruby_ch

    0熱度

    1回答

    我試圖用廚師以下(Centos的VM)的問題: 安裝Ruby 1.9.3 創建一個寶石(「廚師測試」 )這是提供給任何人 上的「廚師測試」安裝兩種寶石(rubocop和foodcritic)寶石 我使用 https://github.com/fnichol/chef-rvm 從包裝食譜中安裝RVM。 這裏是我的食譜的部分,它覆蓋RVM食譜和理論上應該可以在上面做: node.override['r

    47熱度

    1回答

    在我的Rails應用程序中,我使用Rubocop來檢查問題。今天它給了我這樣一個錯誤:Assignment Branch Condition size for show is too high。這裏是我的代碼: def show @category = Category.friendly.find(params[:id]) @categories = Category.all