Skip to content

Commit

Permalink
It is with sincere frustration that I remove this trailing comma from…
Browse files Browse the repository at this point in the history
… an attribute definition. For some reason, this particular autofix will cause intermittent build failures and I can't figure out why
  • Loading branch information
searls committed Jun 24, 2024
1 parent 3a27dcc commit de955ab
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/fixture/cli/autocorrectable-bad.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Something

alias do_more_stuff do_stuff

attr_reader :foo,
attr_reader :foo

def do_stuff( a:,b:,c: )
maths_and_stuff = 4 +
Expand Down
1 change: 1 addition & 0 deletions test/fixture/cli/autocorrectable-good.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Something
alias_method :do_more_stuff, :do_stuff

attr_reader :foo

def do_stuff(a:, b:, c:)
maths_and_stuff = 4 +
5 +
Expand Down
6 changes: 4 additions & 2 deletions test/standard/cli_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ def test_autocorrectable

FileUtils.cp("test/fixture/cli/autocorrectable-bad.rb", "tmp/cli_test/subject.rb")

exit_code = Standard::Cli.new(["tmp/cli_test/subject.rb", "--fix"]).run
do_with_fake_io do
exit_code = Standard::Cli.new(["tmp/cli_test/subject.rb", "--fix"]).run
assert_equal 0, exit_code
end

assert_equal 0, exit_code
assert_equal File.read("test/fixture/cli/autocorrectable-good.rb"), File.read("tmp/cli_test/subject.rb")
end

Expand Down

0 comments on commit de955ab

Please sign in to comment.