Skip to content

Commit

Permalink
Update ameba and address new lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
maxfierke committed Jul 21, 2023
1 parent 9b75758 commit eb98355
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion shard.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2.0
shards:
ameba:
git: https://github.com/crystal-ameba/ameba.git
version: 1.2.0
version: 1.4.3

commander:
git: https://github.com/mrrooijen/commander.git
Expand Down
4 changes: 2 additions & 2 deletions shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies:
development_dependencies:
ameba:
github: crystal-ameba/ameba
version: ~> 1.2.0
version: ~> 1.4.0
spectator:
gitlab: arctic-fox/spectator
version: ~> 0.10.5
Expand All @@ -31,6 +31,6 @@ targets:
mstrap:
main: src/cli.cr

crystal: '>= 1.0.0'
crystal: '>= 1.8.0'

license: MIT
6 changes: 3 additions & 3 deletions src/mstrap/cli.cr
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,12 @@ DESC
else
Defs::ConfigDef.new(
user: Defs::UserDef.new(
name: name.not_nil!,
email: email.not_nil!,
name: name,
email: email,
github: github
),
)
end.not_nil!
end
end

private def load_cli_options!(options)
Expand Down
8 changes: 4 additions & 4 deletions src/mstrap/project.cr
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ module MStrap
@cname = project_def.cname
@name = project_def.name
@hostname = project_def.hostname || "#{cname}.localhost"
@path = File.join(MStrap::Paths::SRC_DIR, project_def.path_present? ? project_def.path.not_nil! : cname)
@path = File.join(MStrap::Paths::SRC_DIR, (project_path = project_def.path) ? project_path : cname)
@port = (port = project_def.port) ? port.to_i32 : nil
@repo = project_def.repo
@repo_upstream = project_def.repo_upstream
Expand Down Expand Up @@ -129,10 +129,10 @@ module MStrap
def clone
success = cmd("git", "clone", git_uri, path, quiet: true)

if success && repo_upstream
if success && repo_upstream && (upstream_uri = git_upstream_uri)
Dir.cd(path) do
success =
cmd("git", "remote", "add", "upstream", git_upstream_uri.not_nil!, quiet: true) &&
cmd("git", "remote", "add", "upstream", upstream_uri, quiet: true) &&
cmd("git", "fetch", "upstream", quiet: true)
end
end
Expand Down Expand Up @@ -221,7 +221,7 @@ module MStrap
`git rev-parse --abbrev-ref HEAD`.chomp
end

private def git_checkpoint
private def git_checkpoint(&)
stash_message = "MSTRAP CHECKPOINT #{Time.utc.to_unix}"

begin
Expand Down
2 changes: 1 addition & 1 deletion src/mstrap/runtime.cr
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ module MStrap
# version or the version specified by the environment.
#
# NOTE: This will not traverse parent directories to find versions files.
def with_dir_version(dir)
def with_dir_version(dir, &)
env_version = ENV[version_env_var]?
begin
Dir.cd(dir) do
Expand Down
2 changes: 1 addition & 1 deletion src/mstrap/runtimes/go.cr
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module MStrap
end
end

private def disable_go_modules
private def disable_go_modules(&)
current_module_setting = ENV["GO111MODULE"]?

begin
Expand Down
2 changes: 1 addition & 1 deletion src/mstrap/runtimes/node.cr
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module MStrap
end
end

private def skip_reshim
private def skip_reshim(&)
ENV["ASDF_SKIP_RESHIM"] = "1"
yield
ensure
Expand Down
2 changes: 1 addition & 1 deletion src/mstrap/steps/projects_step.cr
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module MStrap
private def projects
@projects ||= profile.projects.map do |project_def|
MStrap::Project.for(project_def)
end.not_nil!
end
end

private def has_web_projects?
Expand Down
4 changes: 2 additions & 2 deletions src/mstrap/user.cr
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ module MStrap
getter :github

def initialize(user : Defs::UserDef)
@name = user.name.not_nil!
@email = user.email.not_nil!
@name = user.name || ""
@email = user.email || ""
@github = user.github
end

Expand Down

0 comments on commit eb98355

Please sign in to comment.