Skip to content

Commit

Permalink
🚨 Linting
Browse files Browse the repository at this point in the history
- caveat, linting will fail on autocorrect
- See: skryukov/rubocop-gradual#24 (comment)
  • Loading branch information
pboling committed Sep 5, 2024
1 parent 73e6e3c commit f4fa3c4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
9 changes: 7 additions & 2 deletions .rubocop_gradual.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"bin/bundle:4028066867": [
[64, 5, 20, "ThreadSafety/InstanceVariableInClassMethod: Avoid instance variables in class methods.", 2485198147]
"bin/bundle:3870166066": [
[33, 24, 58, "Performance/ConstantRegexp: Extract this regexp into a constant, memoize it, or append an `/o` option to its options.", 2287896868],
[59, 40, 62, "Performance/ConstantRegexp: Extract this regexp into a constant, memoize it, or append an `/o` option to its options.", 2593609308],
[64, 5, 20, "ThreadSafety/InstanceVariableInClassMethod: Avoid instance variables in class methods.", 2485198147],
[86, 7, 34, "Style/MethodCallWithArgsParentheses: Use parentheses for method calls with arguments.", 991972134],
[93, 5, 194, "Style/MethodCallWithArgsParentheses: Use parentheses for method calls with arguments.", 1374511802],
[94, 5, 7, "Style/MethodCallWithArgsParentheses: Use parentheses for method calls with arguments.", 285434243]
]
}
10 changes: 5 additions & 5 deletions bin/bundle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ m = Module.new do
if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
bundler_version = a
end
next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/o
next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
bundler_version = $1
update_index = i
end
Expand All @@ -56,7 +56,7 @@ m = Module.new do
def lockfile_version
return unless File.file?(lockfile)
lockfile_contents = File.read(lockfile)
return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/o
return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
Regexp.last_match(1)
end

Expand All @@ -83,15 +83,15 @@ m = Module.new do

def activate_bundler
gem_error = activation_error_handling do
gem("bundler", bundler_requirement)
gem "bundler", bundler_requirement
end
return if gem_error.nil?
require_error = activation_error_handling do
require "bundler/version"
end
return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION))
warn("Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`")
exit(42)
warn "Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`"
exit 42
end

def activation_error_handling
Expand Down
8 changes: 8 additions & 0 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
set -vx

bundle install

# Do any other automated setup that you need to do here

0 comments on commit f4fa3c4

Please sign in to comment.