Skip to content

Commit 5ae80b4

Browse files
committed
Remove environment from coverage and lint tasks
These do not need the Rails environment either, and will mean they run faster too.
1 parent ae4baa3 commit 5ae80b4

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

.rubocop.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,6 @@ Rails/SaveBang:
5555
# Don't require Rails environment to be loaded in rake tasks that do not use the Rails environment.
5656
Rails/RakeEnvironment:
5757
Exclude:
58+
- 'lib/tasks/coverage.rake'
5859
- 'lib/tasks/converter.rake'
60+
- 'lib/tasks/lint.rake'

lib/tasks/coverage.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
desc "Check coverage of last test run"
2-
task check_coverage: :environment do
2+
task :check_coverage do
33
require "simplecov"
44

55
SimpleCov.collate Dir["coverage/**/.resultset.json"] do

lib/tasks/lint.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# :nocov:
22
desc "Run all linters"
3-
task lint: :environment do
3+
task :lint do
44
sh "bundle exec rubocop"
55
if Rails.env.development?
66
sh "bundle exec erb_lint --lint-all --autocorrect"

0 commit comments

Comments
 (0)