-
-
Notifications
You must be signed in to change notification settings - Fork 904
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dep: move dev dependencies into Gemfile
Pin the dev dependencies so that dependabot will tell us when new versions are out and we'll get CI results automatically. Make rubocop dependencies conditional on Ruby 3 to work around the constraint of rubocop-shopify requiring ruby 2.7 or higher. Bump rubocop versions and regenerate the rubocop TODO file.
- Loading branch information
1 parent
3b16ed4
commit 31cf417
Showing
5 changed files
with
76 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,43 @@ | ||
# frozen_string_literal: true | ||
|
||
require "rubocop/rake_task" | ||
begin | ||
require("rubocop/rake_task") | ||
|
||
module RubocopHelper | ||
class << self | ||
def common_options(task) | ||
task.patterns += [ | ||
"Gemfile", "Rakefile", "nokogiri.gemspec", | ||
"bin", "ext", "lib", "oci-images", "rakelib", "scripts", "test", | ||
] | ||
end | ||
module RubocopHelper | ||
class << self | ||
def common_options(task) | ||
task.patterns += [ | ||
"Gemfile", "Rakefile", "nokogiri.gemspec", | ||
"bin", "ext", "lib", "oci-images", "rakelib", "scripts", "test", | ||
] | ||
end | ||
|
||
def generated_files(task) | ||
task.patterns += ["lib/nokogiri/css/parser.rb", "lib/nokogiri/css/tokenizer.rb"] | ||
task.options << "--only=Style/FrozenStringLiteralComment" | ||
def generated_files(task) | ||
task.patterns += ["lib/nokogiri/css/parser.rb", "lib/nokogiri/css/tokenizer.rb"] | ||
task.options << "--only=Style/FrozenStringLiteralComment" | ||
end | ||
end | ||
end | ||
end | ||
|
||
namespace "rubocop" do | ||
desc "Generate the rubocop todo list" | ||
RuboCop::RakeTask.new("todo") do |task| | ||
RubocopHelper.common_options(task) | ||
task.options << "--auto-gen-config" | ||
end | ||
Rake::Task["rubocop:todo:auto_correct"].clear | ||
namespace("rubocop") do | ||
desc("Generate the rubocop todo list") | ||
RuboCop::RakeTask.new("todo") do |task| | ||
RubocopHelper.common_options(task) | ||
task.options << "--auto-gen-config" | ||
end | ||
Rake::Task["rubocop:todo:autocorrect"].clear | ||
Rake::Task["rubocop:todo:autocorrect_all"].clear | ||
|
||
desc "Run all checks on a subset of directories" | ||
RuboCop::RakeTask.new("check") { |task| RubocopHelper.common_options(task) } | ||
RuboCop::RakeTask.new("check") { |task| RubocopHelper.generated_files(task) } | ||
desc("Run all checks on a subset of directories") | ||
RuboCop::RakeTask.new("check") { |task| RubocopHelper.common_options(task) } | ||
RuboCop::RakeTask.new("check") { |task| RubocopHelper.generated_files(task) } | ||
|
||
desc "Shortcut for rubocop:check:auto_correct" | ||
task fix: "rubocop:check:auto_correct" | ||
end | ||
desc("Shortcut for rubocop:check:autocorrect") | ||
task(fix: "rubocop:check:autocorrect") | ||
end | ||
|
||
desc "Shortcut for rubocop:check" | ||
task rubocop: "rubocop:check" | ||
desc("Shortcut for rubocop:check") | ||
task(rubocop: "rubocop:check") | ||
rescue LoadError => e | ||
warn("WARNING: rubocop is not available in this environment: #{e}") | ||
end |