Skip to content

Commit f8a6236

Browse files
committed
⬆️ rubocop-lts
- add kettle-soup-cover for code coverage
1 parent d69b7df commit f8a6236

27 files changed

+554
-294
lines changed

.rubocop.yml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
11
inherit_from:
2-
- .rubocop_todo.yml
32
- .rubocop_rspec.yml
43

54
inherit_gem:
65
rubocop-lts: rubocop-lts.yml
76

8-
require:
9-
# Try adding back once we reach rubocop-ruby2_3+
10-
# - 'rubocop-md'
11-
# Can be added once we reach rubocop-ruby2_3+
12-
# - 'rubocop-packaging'
13-
- 'rubocop-performance'
14-
- 'rubocop-rake'
15-
- 'rubocop-rspec'
16-
177
AllCops:
188
DisplayCopNames: true # Display the name of the failing cops
199
Exclude:
@@ -38,7 +28,7 @@ Gemspec/RequiredRubyVersion:
3828
Metrics/BlockNesting:
3929
Max: 2
4030

41-
Metrics/LineLength:
31+
Layout/LineLength:
4232
Enabled: false
4333

4434
Metrics/ParameterLists:
@@ -60,12 +50,6 @@ Lint/UnusedBlockArgument:
6050
- 'vendor/**/*'
6151
- '**/.irbrc'
6252

63-
RSpec/DescribeClass:
64-
Exclude:
65-
- 'spec/examples/*'
66-
67-
RSpec/NestedGroups:
68-
Enabled: false
6953

7054
Style/ClassVars:
7155
Enabled: false

.rubocop_gradual.lock

Lines changed: 207 additions & 0 deletions
Large diffs are not rendered by default.

.rubocop_rspec.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
RSpec/FilePath:
2-
Enabled: false
3-
41
RSpec/MultipleExpectations:
52
Enabled: false
63

@@ -24,3 +21,8 @@ RSpec/NestedGroups:
2421

2522
RSpec/ExpectInHook:
2623
Enabled: false
24+
25+
RSpec/DescribeClass:
26+
Exclude:
27+
- 'spec/examples/*'
28+

.rubocop_todo.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.simplecov

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,3 @@
1-
# frozen_string_literal: true
1+
require "kettle/soup/cover/config"
22

3-
# To get coverage
4-
# On Local, default (HTML) output, it just works, coverage is turned on:
5-
# bundle exec rspec spec
6-
# On Local, all output formats:
7-
# COVER_ALL=true bundle exec rspec spec
8-
#
9-
# On CI, all output formats, the ENV variables CI is always set,
10-
# and COVER_ALL, and CI_CODECOV, are set in the coverage.yml workflow only,
11-
# so coverage only runs in that workflow, and outputs all formats.
12-
#
13-
14-
if RUN_COVERAGE
15-
SimpleCov.start do
16-
enable_coverage :branch
17-
primary_coverage :branch
18-
add_filter 'spec'
19-
add_filter 'lib/oauth2/version.rb'
20-
track_files '**/*.rb'
21-
22-
if ALL_FORMATTERS
23-
command_name "#{ENV['GITHUB_WORKFLOW']} Job #{ENV['GITHUB_RUN_ID']}:#{ENV['GITHUB_RUN_NUMBER']}"
24-
else
25-
formatter SimpleCov::Formatter::HTMLFormatter
26-
end
27-
28-
minimum_coverage(line: 100, branch: 100)
29-
end
30-
else
31-
puts "Not running coverage on #{RUBY_ENGINE} #{RUBY_VERSION}"
32-
end
3+
SimpleCov.start

Gemfile

Lines changed: 23 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,31 @@
11
# frozen_string_literal: true
22

3-
source 'https://rubygems.org'
4-
5-
gemspec
3+
source "https://rubygems.org"
64

75
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
86
git_source(:gitlab) { |repo_name| "https://gitlab.com/#{repo_name}" }
97

10-
gem 'rake', '~> 13.0'
11-
12-
gem 'rspec', '~> 3.0'
13-
14-
ruby_version = Gem::Version.new(RUBY_VERSION)
15-
minimum_version = ->(version, engine = 'ruby') { ruby_version >= Gem::Version.new(version) && RUBY_ENGINE == engine }
16-
linting = minimum_version.call('2.7')
17-
coverage = minimum_version.call('2.7')
18-
debug = minimum_version.call('2.5')
19-
20-
gem 'overcommit', '~> 0.58' if linting
21-
22-
platforms :mri do
23-
if linting
24-
# Danger is incompatible with Faraday 2 (for now)
25-
# see: https://github.com/danger/danger/issues/1349
26-
# gem 'danger', '~> 8.4'
27-
# Commented out rubocop-md because of the <--rubocop/md--> bug
28-
# gem 'rubocop-md', require: false
29-
# Can be added once we reach rubocop-lts >= v10 (i.e. drop Ruby 2.2)
30-
# gem 'rubocop-packaging', require: false
31-
gem 'rubocop-performance', require: false
32-
gem 'rubocop-rake', require: false
33-
gem 'rubocop-rspec', require: false
34-
gem 'rubocop-thread_safety', require: false
35-
end
36-
if coverage
37-
gem 'codecov', '~> 0.6' # For CodeCov
38-
gem 'simplecov', '~> 0.21', require: false
39-
gem 'simplecov-cobertura' # XML for Jenkins
40-
gem 'simplecov-json' # For CodeClimate
41-
gem 'simplecov-lcov', '~> 0.8', require: false
42-
end
43-
if debug
44-
# Add `byebug` to your code where you want to drop to REPL
45-
gem 'byebug'
46-
end
47-
end
48-
platforms :jruby do
49-
# Add `binding.pry` to your code where you want to drop to REPL
50-
gem 'pry-debugger-jruby'
51-
end
8+
#### IMPORTANT #######################################################
9+
# Gemfile is for local development ONLY; Gemfile is NOT loaded in CI #
10+
####################################################### IMPORTANT ####
11+
12+
# Include dependencies from <gem name>.gemspec
13+
gemspec
5214

53-
### deps for documentation and rdoc.info
54-
group :documentation do
55-
gem 'github-markup', platform: :mri
56-
gem 'redcarpet', platform: :mri
57-
gem 'yard', require: false
15+
platform :mri do
16+
# Use binding.break, binding.b, or debugger in code
17+
gem "debug", ">= 1.0.0" # ruby >= 2.7
18+
gem "gem_bench", "~> 2.0", ">= 2.0.5"
5819
end
20+
21+
# Security Audit
22+
eval_gemfile "gemfiles/modular/audit.gemfile"
23+
24+
# Code Coverage
25+
eval_gemfile "gemfiles/modular/coverage.gemfile"
26+
27+
# Linting
28+
eval_gemfile "gemfiles/modular/style.gemfile"
29+
30+
# Documentation
31+
eval_gemfile "gemfiles/modular/documentation.gemfile"

0 commit comments

Comments
 (0)