Skip to content

Commit

Permalink
Fix Rubocop offenses automatically
Browse files Browse the repository at this point in the history
Fix Rubocop offenses with:

`bundle exec rake dev:lint:rubocop:auto_correct`
  • Loading branch information
eduardoj committed Mar 7, 2022
1 parent 230eccd commit 98a351e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/api/app/controllers/source_controller.rb
Expand Up @@ -188,9 +188,7 @@ def package_command
@target_package_name,
follow_project_links: SOURCE_UNTOUCHED_COMMANDS.include?(@command))
# is a local project, which is not scm managed. Or using a command not supported for scm projects.
if @project.is_a?(String) || @project.scmsync.blank? || SCM_SYNC_PROJECT_COMMANDS.exclude?(@command)
validate_target_for_package_command_exists!
end
validate_target_for_package_command_exists! if @project.is_a?(String) || @project.scmsync.blank? || SCM_SYNC_PROJECT_COMMANDS.exclude?(@command)
end
end

Expand All @@ -205,7 +203,7 @@ def package_command
READ_COMMANDS = ['branch', 'diff', 'linkdiff', 'servicediff', 'showlinked', 'getprojectservices', 'release'].freeze
# commands which are fine to operate on external scm managed projects
SCM_SYNC_PROJECT_COMMANDS = ['diff', 'linkdiff', 'showlinked', 'copy', 'remove_flag', 'set_flag', 'runservice',
'waitservice', 'getprojectservices', 'unlock', 'wipe', 'rebuild', 'collectbuildenv' ].freeze
'waitservice', 'getprojectservices', 'unlock', 'wipe', 'rebuild', 'collectbuildenv'].freeze

def validate_target_for_package_command_exists!
@project = nil
Expand Down

0 comments on commit 98a351e

Please sign in to comment.