Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crystal tool format with 1.8-dev #575

Merged
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
2 changes: 1 addition & 1 deletion spec/support/cli.cr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Spec.before_each do
end
end

def with_shard(metadata, lock = nil, override = nil)
def with_shard(metadata, lock = nil, override = nil, &)
Dir.cd(application_path) do
File.write "shard.yml", to_shard_yaml(metadata)
File.write "shard.lock", to_lock_yaml(lock) if lock
Expand Down
2 changes: 1 addition & 1 deletion src/commands/command.cr
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module Shards
Shards::Lock.write(packages, override_path, LOCK_FILENAME)
end

def handle_resolver_errors
def handle_resolver_errors(&)
yield
rescue e : Molinillo::ResolverError
Log.error { e.message }
Expand Down
4 changes: 2 additions & 2 deletions src/ext/yaml.cr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module YAML
class PullParser
# Iterates a sequence, yielding on each new entry until the sequence is
# terminated.
def each_in_sequence : Nil
def each_in_sequence(&) : Nil
read_sequence_start
until kind == YAML::EventKind::SEQUENCE_END
yield
Expand All @@ -14,7 +14,7 @@ module YAML

# Iterates a mapping, yielding on each new entry until the mapping is
# terminated.
def each_in_mapping : Nil
def each_in_mapping(&) : Nil
read_mapping_start
until kind == YAML::EventKind::MAPPING_END
yield
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/fossil.cr
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ module Shards
end
end

private def fossil_retry(err = "Failed to fetch repository")
private def fossil_retry(err = "Failed to fetch repository", &)
retries = 0
loop do
yield
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/git.cr
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ module Shards
end
end

private def git_retry(err = "Failed to fetch repository")
private def git_retry(err = "Failed to fetch repository", &)
retries = 0
loop do
yield
Expand Down
2 changes: 1 addition & 1 deletion src/resolvers/hg.cr
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ module Shards
end
end

private def hg_retry(err = "Failed to update repository")
private def hg_retry(err = "Failed to update repository", &)
retries = 0
loop do
return yield
Expand Down
2 changes: 1 addition & 1 deletion src/versions.cr
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ module Shards
end
end

def only_zeroes?
def only_zeroes?(&)
return if empty?
yield unless to_i? == 0

Expand Down