diff --git a/.gitignore b/.gitignore index 7b5c283..9ec7ed6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ vendor/ .bundle/ +pkg/ diff --git a/Gemfile.lock b/Gemfile.lock index c450ff2..73d17ab 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,6 +11,7 @@ GEM parser (3.1.2.0) ast (~> 2.4.1) rainbow (3.1.1) + rake (13.0.6) regexp_parser (2.4.0) rexml (3.2.5) rubocop (1.29.1) @@ -24,6 +25,8 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.18.0) parser (>= 3.1.1.0) + rubocop-rake (0.6.0) + rubocop (~> 1.0) ruby-progressbar (1.11.0) unicode-display_width (2.1.0) @@ -32,7 +35,9 @@ PLATFORMS DEPENDENCIES format-staged! + rake (~> 13.0) rubocop (~> 1.29) + rubocop-rake (~> 0.6) BUNDLED WITH 2.1.4 diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..24bf06e --- /dev/null +++ b/Rakefile @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +require 'bundler/gem_tasks' + +begin + Bundler.setup(:default, :development) +rescue Bundler::BundlerError => e + warn e.message + warn 'Run `bundle install` to install missing gems' + exit e.status_code +end + +require 'rubocop/rake_task' + +desc 'Run RuboCop' +RuboCop::RakeTask.new(:lint) diff --git a/format-staged.gemspec b/format-staged.gemspec index ff70c99..bf7935a 100644 --- a/format-staged.gemspec +++ b/format-staged.gemspec @@ -15,9 +15,11 @@ Gem::Specification.new do |s| s.executables << 'git-format-staged' s.homepage = 'https://github.com/5sw/format-staged' s.license = 'MIT' - s.required_ruby_version = '2.7' + s.required_ruby_version = '~> 2.7' + s.add_development_dependency 'rake', '~> 13.0' s.add_development_dependency 'rubocop', '~> 1.29' + s.add_development_dependency 'rubocop-rake', '~> 0.6' s.metadata = { 'rubygems_mfa_required' => 'true'