diff options
author | Achilleas Pipinellis <axil@gitlab.com> | 2022-06-10 14:48:18 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2022-06-10 14:48:18 +0300 |
commit | fef84c1eb52354395c42b8087aca5db67b890f2b (patch) | |
tree | 02cea44d21b5f7f8e17f3f62b34ea870764d59c4 | |
parent | 2057c1fb5c1436f6189e3c0ce2a9b95ab107ed9d (diff) | |
parent | 95ecd4954ea689149d9a610aca5986bb500339b6 (diff) |
Merge branch 'eread/fix-if-unless-modifier-rubocop-offenses' into 'main'
Fix Style/IfUnlessModifier RuboCop offenses
See merge request gitlab-org/gitlab-docs!2788
-rw-r--r-- | Rakefile | 8 | ||||
-rw-r--r-- | commands/frontend.rb | 4 |
2 files changed, 3 insertions, 9 deletions
@@ -136,9 +136,7 @@ namespace :release do desc 'Creates merge requests to update the dropdowns in all online versions' task :dropdowns do # Check if you're on the default branch before starting. Fail if you are. - if `git branch --show-current`.tr("\n", '') == ENV['CI_DEFAULT_BRANCH'] - abort("\n#{COLOR_CODE_RED}ERROR: You are on the default branch. Create the current release branch and run the Rake task again.#{COLOR_CODE_RESET}") - end + abort("\n#{COLOR_CODE_RED}ERROR: You are on the default branch. Create the current release branch and run the Rake task again.#{COLOR_CODE_RESET}") if `git branch --show-current`.tr("\n", '') == ENV['CI_DEFAULT_BRANCH'] # Load online versions versions = YAML.load_file('./content/_data/versions.yaml') @@ -150,9 +148,7 @@ namespace :release do release_branch = "release-#{current_version.tr('.', '-')}" # Check if a release branch has been created, if not fail and warn the user - if `git rev-parse --verify #{release_branch}`.empty? - abort("\n#{COLOR_CODE_RED}ERROR: A release branch for the latest stable version has not been created.#{COLOR_CODE_RESET}") - end + abort("\n#{COLOR_CODE_RED}ERROR: A release branch for the latest stable version has not been created.#{COLOR_CODE_RESET}") if `git rev-parse --verify #{release_branch}`.empty? # Create a merge request to update the dropdowns in all online versions versions['online'].each do |version| diff --git a/commands/frontend.rb b/commands/frontend.rb index 0b669ef3..edc77ae3 100644 --- a/commands/frontend.rb +++ b/commands/frontend.rb @@ -44,8 +44,6 @@ run do |opts, args, cmd| Dir.mkdir gl_ui_dest Dir.children("#{gl_ui_src}").each do |filename| - if filename.include?("css") && File.write("#{gl_ui_dest}/#{filename}", File.read("#{root}/#{gl_ui_src}/#{filename}")) - puts "Copied #{gl_ui_src}/#{filename}" - end + puts "Copied #{gl_ui_src}/#{filename}" if filename.include?("css") && File.write("#{gl_ui_dest}/#{filename}", File.read("#{root}/#{gl_ui_src}/#{filename}")) end end |