{"record":{"id":"7223987f2a74f7ed","repo":"sds/overcommit","slug":"raketarget-targets-parameter-is-empty-add-at-lea","errorCode":null,"errorMessage":"RakeTarget: targets parameter is empty. Add at least one task to the targets parameter. Valid: Array of target names or String of target names","messagePattern":"RakeTarget: targets parameter is empty\\. Add at least one task to the targets parameter\\. Valid: Array of target names or String of target names","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"lib/overcommit/hook/shared/rake_target.rb","lineNumber":12,"sourceCode":"# frozen_string_literal: true\n\nmodule Overcommit::Hook::Shared\n  # runs specified rake targets. It fails on the first non-\n  # successful exit.\n  #\n  module RakeTarget\n    def run\n      targets = config['targets']\n\n      if Array(targets).empty?\n        raise 'RakeTarget: targets parameter is empty. Add at least one task to ' \\\n          'the targets parameter. Valid: Array of target names or String of ' \\\n          'target names'\n      end\n\n      targets.each do |task|\n        result = execute(command + [task])\n        unless result.success?\n          return :fail, \"Rake target #{task}:\\n#{result.stdout}\"\n        end\n      end\n      :pass\n    end\n  end\nend\n","sourceCodeStart":1,"sourceCodeEnd":27,"githubUrl":"https://github.com/sds/overcommit/blob/fee0cd74b26eb81f64b43b7fab17bbb541575cc4/lib/overcommit/hook/shared/rake_target.rb#L1-L27","documentation":"Error \"RakeTarget: targets parameter is empty. Add at least one task to the targets parameter. Valid: Array of target names or String of target names\" thrown in sds/overcommit.","triggerScenarios":"Thrown at lib/overcommit/hook/shared/rake_target.rb:12 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a non-empty `targets` array (or space-separated string) of rake task names to the hook's configuration in .overcommit.yml, e.g. `targets: ['spec', 'lint']`.","Remove the hook from your configuration if you do not intend to run any rake targets."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fee0cd74b26eb81f64b43b7fab17bbb541575cc4","analyzedAt":"2026-08-23T04:07:28.153Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}