Skip to content

Commit 2c47408

Browse files
committed
help RuboCop pick the correct config
The problem is that RuboCop by default picked the inner most config file. This means that if we want to use RuboCop for Pliny itself with a .rubocop.yml config in the project root, we allways need to append `-c .rubocop.yml`. If you don't do this you are greeted with a lot of errors. Which is especially annoying if you have RuboCop integrated in your editor. With this change it works out of the box. With a minimal trade-off by renaming the template.
1 parent e9696b1 commit 2c47408

4 files changed

Lines changed: 3 additions & 1 deletion

File tree

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ jobs:
2323
ruby-version: ${{ matrix.ruby-version }}
2424
bundler-cache: true
2525
- name: Run RuboCop
26-
run: bundle exec rubocop -c .rubocop.yml
26+
run: bundle exec rubocop

lib/pliny/commands/creator.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def run!
2626

2727
FileUtils.copy_entry template_dir, app_dir
2828
FileUtils.rm_rf("#{app_dir}/.git")
29+
FileUtils.mv("#{app_dir}/.rubocop_template.yml", "#{app_dir}/.rubocop.yml")
2930
parse_erb_files
3031
display "Pliny app created. To start, run:"
3132
display "cd #{app_dir} && bin/setup"

spec/commands/creator_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
@gen.run!
2222
assert File.exist?("./foobar")
2323
assert File.exist?("./foobar/Gemfile")
24+
assert File.exist?("./foobar/.rubocop.yml")
2425
end
2526

2627
it "deletes the .git from it" do

0 commit comments

Comments
 (0)