Skip to content

Commit 0cda157

Browse files
Merge pull request #323 from crystal-lang/ci/crystal-tool-format
Run crystal tool format --check in travis
2 parents 38b3d21 + 4409026 commit 0cda157

File tree

7 files changed

+27
-25
lines changed

7 files changed

+27
-25
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ dry:
1414
- run: shards install
1515
- run: make
1616
- run: make test
17+
- run: crystal tool format --check
1718

1819
jobs:
1920
test:

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ before_script: |
1212
1313
script:
1414
- make test
15+
- crystal tool format --check

test/dependency_test.cr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ class Shards::DependencyTest < Minitest::Test
1616
end
1717

1818
def test_version_with_tags
19-
dependency = Dependency.new("app", { tag: "fix/something" })
19+
dependency = Dependency.new("app", {tag: "fix/something"})
2020
assert_equal "*", dependency.version
2121

22-
dependency = Dependency.new("app", { tag: "1.2.3" })
22+
dependency = Dependency.new("app", {tag: "1.2.3"})
2323
assert_equal "*", dependency.version
2424

2525
# version tag is considered a version:
26-
dependency = Dependency.new("app", { tag: "v1.2.3-pre1" })
26+
dependency = Dependency.new("app", {tag: "v1.2.3-pre1"})
2727
assert_equal "1.2.3-pre1", dependency.version
2828
end
2929
end

test/integration/install_test.cr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ class InstallCommandTest < Minitest::Test
7474
def test_installs_prerelease_version_at_refs
7575
metadata = {
7676
dependencies: {
77-
unstable: {git: git_url(:unstable), branch: "master"}
78-
}
77+
unstable: {git: git_url(:unstable), branch: "master"},
78+
},
7979
}
8080
with_shard(metadata) do
8181
run "shards install"
@@ -130,7 +130,7 @@ class InstallCommandTest < Minitest::Test
130130
def test_installs_dependency_at_locked_commit_when_refs_is_a_branch
131131
metadata = {
132132
dependencies: {
133-
web: {git: git_url(:web), branch: "master"}
133+
web: {git: git_url(:web), branch: "master"},
134134
},
135135
}
136136
lock = {web: git_commits(:web)[-5]}
@@ -161,10 +161,10 @@ class InstallCommandTest < Minitest::Test
161161
metadata = {
162162
dependencies: {
163163
"locked": {git: git_path(:"locked"), branch: "master"},
164-
}
164+
},
165165
}
166166
lock = {
167-
"locked": git_commits(:"locked").last
167+
"locked": git_commits(:"locked").last,
168168
}
169169
with_shard(metadata, lock) { run "shards install" }
170170

@@ -310,7 +310,7 @@ class InstallCommandTest < Minitest::Test
310310
end
311311

312312
def test_runs_postinstall_with_transitive_dependencies
313-
with_shard({ dependencies: {transitive: "*"} }) do
313+
with_shard({dependencies: {transitive: "*"}}) do
314314
run "shards install"
315315
binary = File.join(application_path, "lib", "transitive", "version")
316316
assert File.exists?(binary)
@@ -332,7 +332,7 @@ class InstallCommandTest < Minitest::Test
332332

333333
def test_installs_executables_at_version
334334
metadata = {
335-
dependencies: {binary: "0.1.0"}
335+
dependencies: {binary: "0.1.0"},
336336
}
337337
with_shard(metadata) { run("shards install --no-color") }
338338

@@ -351,7 +351,7 @@ class InstallCommandTest < Minitest::Test
351351
def test_installs_executables_at_refs
352352
metadata = {
353353
dependencies: {
354-
binary: {git: git_url(:binary), commit: git_commits(:binary)[-1]}
354+
binary: {git: git_url(:binary), commit: git_commits(:binary)[-1]},
355355
},
356356
}
357357
with_shard(metadata) { run("shards install --no-color") }

test/integration/update_test.cr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class UpdateCommandTest < Minitest::Test
5555
end
5656

5757
def test_updates_specified_dependencies
58-
metadata = { dependencies: {web: "*", orm: "*", optional: "*"}, }
58+
metadata = {dependencies: {web: "*", orm: "*", optional: "*"}}
5959
lock = {web: "1.0.0", orm: "0.4.0", optional: "0.2.0"}
6060

6161
with_shard(metadata, lock) do
@@ -78,7 +78,7 @@ class UpdateCommandTest < Minitest::Test
7878
end
7979

8080
def test_wont_install_prerelease_version
81-
metadata = { dependencies: {unstable: "*"} }
81+
metadata = {dependencies: {unstable: "*"}}
8282
lock = {unstable: "0.1.0"}
8383

8484
with_shard(metadata, lock) do
@@ -89,7 +89,7 @@ class UpdateCommandTest < Minitest::Test
8989
end
9090

9191
def test_installs_specified_prerelease_version
92-
metadata = { dependencies: {unstable: "~> 0.3.0.alpha"} }
92+
metadata = {dependencies: {unstable: "~> 0.3.0.alpha"}}
9393
lock = {unstable: "0.3.0.alpha"}
9494

9595
with_shard(metadata, lock) do
@@ -100,7 +100,7 @@ class UpdateCommandTest < Minitest::Test
100100
end
101101

102102
def test_updates_locked_specified_prerelease
103-
metadata = { dependencies: {unstable: "~> 0.3.0.alpha"} }
103+
metadata = {dependencies: {unstable: "~> 0.3.0.alpha"}}
104104
lock = {unstable: "0.3.0.alpha"}
105105

106106
with_shard(metadata, lock) do
@@ -111,7 +111,7 @@ class UpdateCommandTest < Minitest::Test
111111
end
112112

113113
def test_updates_from_prerelease_to_release_with_approximate_operator
114-
metadata = { dependencies: {preview: "~> 0.3.0.a"} }
114+
metadata = {dependencies: {preview: "~> 0.3.0.a"}}
115115
lock = {preview: "0.3.0.alpha"}
116116

117117
with_shard(metadata, lock) do
@@ -123,7 +123,7 @@ class UpdateCommandTest < Minitest::Test
123123

124124
# TODO: detect version, and prefer release (0.3.0) over further prereleases (?)
125125
def test_updates_to_latest_prerelease_with_gte_operator
126-
metadata = { dependencies: {preview: ">= 0.3.0.a"} }
126+
metadata = {dependencies: {preview: ">= 0.3.0.a"}}
127127
lock = {preview: "0.3.0.a"}
128128

129129
with_shard(metadata, lock) do
@@ -208,7 +208,7 @@ class UpdateCommandTest < Minitest::Test
208208
end
209209

210210
def test_runs_postinstall_with_transitive_dependencies
211-
with_shard({ dependencies: {transitive: "*"} }, {transitive: "0.1.0"}) do
211+
with_shard({dependencies: {transitive: "*"}}, {transitive: "0.1.0"}) do
212212
run "shards update"
213213
binary = File.join(application_path, "lib", "transitive", "version")
214214
assert File.exists?(binary)
@@ -236,7 +236,7 @@ class UpdateCommandTest < Minitest::Test
236236

237237
def test_doesnt_update_local_cache
238238
metadata = {
239-
dependencies: { local_cache: "*" },
239+
dependencies: {local_cache: "*"},
240240
}
241241

242242
with_shard(metadata) do

test/integration_helper.cr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ class Minitest::Test
5353
create_path_repository "foo", "0.1.0"
5454

5555
# dependency with neither a shard.yml and/or version tags:
56-
#create_git_repository "empty"
57-
#create_git_commit "empty", "initial release"
56+
# create_git_repository "empty"
57+
# create_git_commit "empty", "initial release"
5858

5959
create_git_repository "missing"
6060
create_shard "missing", "name: missing\nversion: 0.1.0\n"

test/support/cli.cr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ module Shards
3939
when String
4040
yml << " git: " << git_url(name).inspect << '\n'
4141
yml << " version: " << version.inspect << '\n'
42-
#when Hash
43-
# version.each do |k, v|
44-
# yml << " " << k << ": " << v.inspect << '\n'
45-
# end
42+
# when Hash
43+
# version.each do |k, v|
44+
# yml << " " << k << ": " << v.inspect << '\n'
45+
# end
4646
when NamedTuple
4747
version.each do |k, v|
4848
yml << " " << k.to_s << ": " << v.inspect << '\n'

0 commit comments

Comments
 (0)