Skip to content
Snippets Groups Projects
Verified Commit e458f525 authored by Stan Hu's avatar Stan Hu
Browse files

Avoid calling Git in gitlab-backup-cli.gemspec

!135760
introduced a new gitlab-backup-cli gem, but it executed `git`, which
is not present in Cloud Native GitLab.

Fix this by avoiding `git` and fixing the Rubocop rules to inherit
from the parent gems config.

Changelog: changed
parent 7361bbda
No related branches found
No related tags found
1 merge request!136623Avoid calling Git in gitlab-backup-cli.gemspec
---
inherit_gem:
gitlab-styles:
- rubocop-bundler.yml
- rubocop-fips.yml
- rubocop-gemspec.yml
- rubocop-layout.yml
- rubocop-lint.yml
- rubocop-metrics.yml
- rubocop-naming.yml
- rubocop-performance.yml
- rubocop-rspec.yml
- rubocop-security.yml
- rubocop-style.yml
AllCops:
TargetRubyVersion: 3.0
SuggestExtensions: false
NewCops: disable
inherit_from:
- ../config/rubocop.yml
......@@ -19,16 +19,6 @@ Gem::Specification.new do |spec|
spec.metadata["source_code_uri"] = spec.homepage
spec.files = Dir['lib/**/*.rb']
spec.test_files = Dir['spec/**/*']
# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
spec.files = Dir.chdir(__dir__) do
`git ls-files -z`.split("\x0").reject do |f|
(File.expand_path(f) == __FILE__) ||
f.start_with?(*%w[bin/ test/ spec/ features/ .git .gitlab-ci .rspec .rubocop.yml Gemfile])
end
end
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
......
......@@ -7,7 +7,7 @@ module Cli
autoload :VERSION, 'gitlab/backup/cli/version'
autoload :Runner, 'gitlab/backup/cli/runner'
class Error < StandardError; end
Error = Class.new(StandardError)
# Your code goes here...
end
end
......
......@@ -18,7 +18,7 @@ def self.exit_on_failure?
desc 'version', 'Display the version information'
def version
puts "GitLab Backup CLI (#{VERSION})"
puts "GitLab Backup CLI (#{VERSION})" # rubocop:disable Rails/Output -- CLI output
end
private
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment