Bump ameba dependency and fix found issues

This commit is contained in:
Sijawusz Pur Rahnama 2023-03-06 05:58:15 +01:00
parent 8410b11478
commit a7eed4b230
5 changed files with 11 additions and 7 deletions

3
.ameba.yml Normal file
View file

@ -0,0 +1,3 @@
Lint/NotNil:
Excluded:
- spec/backtracer/backtrace/frame/parser_spec.cr

View file

@ -7,7 +7,7 @@ authors:
development_dependencies:
ameba:
github: crystal-ameba/ameba
version: ~> 1.2.0
version: ~> 1.4.0
crystal: ">= 0.35.0"

View file

@ -1,6 +1,6 @@
require "../../../spec_helper"
def with_foo_context
def with_foo_context(&)
yield Backtracer::Backtrace::Frame::Context.new(
lineno: 10,
pre: %w[foo bar baz],

View file

@ -1,15 +1,15 @@
require "spec"
require "../src/backtracer"
def with_configuration(shared = true)
def with_configuration(shared = true, &)
yield shared ? Backtracer.configuration : Backtracer::Configuration.new
end
def with_backtrace(backtrace, **options)
def with_backtrace(backtrace, **options, &)
yield Backtracer::Backtrace::Parser.parse(backtrace, **options)
end
def with_frame(method, path = nil, lineno = nil, column = nil, **options)
def with_frame(method, path = nil, lineno = nil, column = nil, **options, &)
line = String.build do |io|
if path
io << path
@ -28,7 +28,8 @@ def with_foo_frame(
path = "#{__DIR__}/foo.cr",
lineno = 1,
column = 7,
**options
**options,
&
)
with_frame(method, path, lineno, column, **options) do |frame|
yield frame

View file

@ -1,7 +1,7 @@
module Backtracer
class_getter(configuration) { Configuration.new }
def self.configure : Nil
def self.configure(&) : Nil
yield configuration
end