Skip to content

Commit

Permalink
Replaces bin/lint with rubocop binstub
Browse files Browse the repository at this point in the history
  • Loading branch information
nolantait committed Sep 4, 2024
1 parent c7374a1 commit f191aa2
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 20 deletions.
18 changes: 0 additions & 18 deletions bin/lint

This file was deleted.

27 changes: 27 additions & 0 deletions bin/rubocop
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'rubocop' is installed as part of a gem, and
# this file is here to facilitate running it.
#

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

bundle_binstub = File.expand_path("bundle", __dir__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end

require "rubygems"
require "bundler/setup"

load Gem.bin_path("rubocop", "rubocop")
4 changes: 2 additions & 2 deletions lib/protos/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ class Component < Phlex::HTML
option :html_options, default: -> { {} }, reader: false

# Adds non-defined options to the html_options hash
def initialize(*args, **kwargs, &)
def initialize(*, **kwargs, &)
defined_keys = self.class.dry_initializer.definitions.keys
defined, undefined =
kwargs
.partition { |key, _| defined_keys.include?(key) }
.map!(&:to_h)

super(*args, html_options: undefined, **defined, &)
super(*, html_options: undefined, **defined, &)
end

private
Expand Down
2 changes: 2 additions & 0 deletions spec/support/capybara.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "capybara/rspec"
require "phlex/testing/capybara"

Expand Down
2 changes: 2 additions & 0 deletions spec/support/matchers.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class HaveStimulusTarget
def initialize(controller, target)
@controller = controller
Expand Down

0 comments on commit f191aa2

Please sign in to comment.