Skip to content

Commit b230eeb

Browse files
Simplify calling rubocop and rails_best_practices (#2411)
* Simplify calling rubocop and rails_best_practices Signed-off-by: David A. Wheeler <[email protected]> * Cleanup comments Signed-off-by: David A. Wheeler <[email protected]> --------- Signed-off-by: David A. Wheeler <[email protected]>
1 parent 0e48299 commit b230eeb

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

config/rails_best_practices.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Configuration file for tool rails_best_practices
22
# Note: Inside { } you can use "except_methods:" and "ignored_files:" to omit
33
# some checks.
4+
5+
# Equivalent to : --features --spec --without-color --exclude railroader/
6+
features: true
7+
spec: true
8+
without_color: true
9+
exclude: ["railroader/"]
10+
411
AddModelVirtualAttributeCheck: { }
512
AlwaysAddDbIndexCheck: { }
613
CheckSaveReturnValueCheck: { }

lib/tasks/default.rake

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,16 @@ task :rbenv_rvm_setup do
7272
end
7373
end
7474

75-
desc 'Run Rubocop with options'
75+
desc 'Run Rubocop'
7676
task :rubocop do
77-
sh 'bundle exec rubocop -D --format progress'
77+
# The default configuration is in .rubocop.yml
78+
sh 'bundle exec rubocop'
7879
end
7980

8081
desc 'Run rails_best_practices with options'
8182
task :rails_best_practices do
82-
sh 'bundle exec rails_best_practices --features --spec --without-color --exclude railroader/'
83+
# The default configuration is in config/rails_best_practices.yml
84+
sh 'bundle exec rails_best_practices'
8385
end
8486

8587
desc 'Setup railroader if needed'
@@ -183,10 +185,12 @@ task :bundle_audit do
183185
end
184186
# rubocop:enable Metrics/BlockLength
185187

188+
# Use markdownlint to examine the usual markdown files.
186189
# NOTE: If you don't want mdl to be run on a markdown file, rename it to
187190
# end in ".markdown" instead. (E.g., for markdown fragments.)
188191
desc 'Run markdownlint (mdl) - check for markdown problems on **.md files'
189192
task :markdownlint do
193+
# The default configuration is in .mdlrc + style config/markdown_style.rb
190194
sh 'bundle exec mdl *.md docs/*.md'
191195
end
192196

@@ -436,6 +440,7 @@ else
436440
t.pattern = 'app/assets/javascripts/*.js'
437441
# If you modify the exclude_pattern, also modify file .eslintignore
438442
t.exclude_pattern = 'app/assets/javascripts/application.js'
443+
# The configuration is in .eslintrc
439444
t.options = :eslintrc
440445
end
441446
end

0 commit comments

Comments
 (0)