Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## HEAD (unreleased)

- Reduce timeout to 1 second (https://github.com/zombocom/dead_end/pull/79)
- Logically consecutive lines (such as chained methods are now joined) (https://github.com/zombocom/dead_end/pull/78)
- Output improvement for cases where the only line is an single `end` (https://github.com/zombocom/dead_end/pull/78)

Expand Down
2 changes: 1 addition & 1 deletion lib/dead_end/internals.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
module DeadEnd
class Error < StandardError; end
SEARCH_SOURCE_ON_ERROR_DEFAULT = true
TIMEOUT_DEFAULT = ENV.fetch("DEAD_END_TIMEOUT", 5).to_i
TIMEOUT_DEFAULT = ENV.fetch("DEAD_END_TIMEOUT", 1).to_i

def self.handle_error(e, search_source_on_error: SEARCH_SOURCE_ON_ERROR_DEFAULT)
raise e unless e.message.include?("end-of-input")
Expand Down
19 changes: 19 additions & 0 deletions spec/integration/improvement_regression_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@

module DeadEnd
RSpec.describe "Library only integration to test regressions and improvements" do
it "returns good results on routes.rb" do
source = fixtures_dir.join("routes.rb.txt").read

io = StringIO.new
DeadEnd.call(
io: io,
source: source,
filename: "none"
)

expect(io.string).to include(<<~'EOM'.indent(4))
1 Rails.application.routes.draw do
❯ 113 namespace :admin do
❯ 116 match "/foobar(*path)", via: :all, to: redirect { |_params, req|
❯ 120 }
121 end
EOM
end

it "handles multi-line-methods issues/64" do
source = fixtures_dir.join("webmock.rb.txt").read

Expand Down
31 changes: 0 additions & 31 deletions spec/perf/perf_spec.rb

This file was deleted.