codeclimate 0.14.4 → 0.14.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bea54a5cb0fd28dff4dace4113e3daa47202f430
4
- data.tar.gz: b79903b3a89cda679a49fff516ddab90885e4cae
3
+ metadata.gz: 11171f9d7ad3325e8abac63936c5efeef978f5b7
4
+ data.tar.gz: 37a9cd60b0718bd03ddb3c5fc0a1675cedc8c991
5
5
  SHA512:
6
- metadata.gz: f75e1d353a5476ab13e52e7114879527e5777b7dd484c5d86a9902329a1f76a92ce789f06a34ad92dddaeed25e89f9d1bf0bc867aa34494325e258a8f6820f8b
7
- data.tar.gz: 2c428e8609deeeae40ef26d775249b5552d8be4fba4539cc35e48a6cc9cfdf51bc80c7eaa2d41db52565588784b870c34c891351d00723539d213ddb90cfb466
6
+ metadata.gz: daf6c470c221a08e7a8545440ae5d05f3f0a61616087cc99bda596890af6b578f5545300d9874efce310a3f803c207946e4345365c276055f7d8a12e1da295da
7
+ data.tar.gz: 5921b2c2fe7abb7a33626d42875130992d379aa12f67c386323537307a8a3d2bef914f9c6f234c3a81d70e788627e17e80f2f80a80195cf2b09aff3e963cf036
@@ -33,10 +33,11 @@ git add VERSION Gemfile.lock
33
33
  git commit -m "Release v$version"
34
34
  git push origin $branch
35
35
 
36
+ compare_link="https://github.com/codeclimate/codeclimate/compare/${old_version}...$(git rev-parse --short $branch)"
36
37
  if command -v hub > /dev/null 2>&1; then
37
- hub pull-request -m "Release v$version"
38
+ hub pull-request -m "Release v$version\n\n$compare_link"
38
39
  elif command -v gh > /dev/null 2>&1; then
39
- gh pull-request -m "Release v$version"
40
+ gh pull-request -m "Release v$version\n\n$compare_link"
40
41
  else
41
42
  echo "hub not installed? Please open the PR manually" >&2
42
43
  fi
@@ -4,21 +4,16 @@
4
4
  #
5
5
  # Assumes bin/prep-release was run and the PR merged.
6
6
  #
7
- # Usage: bin/release VERSION
7
+ # Usage: bin/release
8
8
  #
9
9
  ###
10
10
  set -e
11
11
 
12
- if [ -z "$1" ]; then
13
- echo "usage: bin/release VERSION" >&2
14
- exit 64
15
- fi
16
-
17
- version=$1
18
-
19
12
  git checkout master
20
13
  git pull
21
14
 
15
+ version=$(< VERSION)
16
+
22
17
  printf "RELEASE %s\n" "$version"
23
18
  rake release
24
19
 
@@ -57,10 +57,10 @@ module CC
57
57
  _, status = Process.waitpid2(pid)
58
58
 
59
59
  if @timed_out
60
- duration = timeout
60
+ duration = timeout * 1000
61
61
  @listener.timed_out(container_data(duration: duration))
62
62
  else
63
- sleep 0.01 until !t_out.alive? && !t_err.alive?
63
+ sleep 1 until !t_out.alive? && !t_err.alive?
64
64
  duration = ((Time.now - started) * 1000).round
65
65
  @listener.finished(container_data(duration: duration, status: status))
66
66
  end
@@ -74,14 +74,7 @@ module CC
74
74
  @stderr_io.string,
75
75
  )
76
76
  ensure
77
- t_timeout.kill if t_timeout
78
- if @timed_out
79
- t_out.kill if t_out
80
- t_err.kill if t_err
81
- else
82
- t_out.join if t_out
83
- t_err.join if t_err
84
- end
77
+ [t_timeout, t_out, t_err].each { |t| t.kill if t }
85
78
  end
86
79
 
87
80
  def stop
@@ -128,10 +121,18 @@ module CC
128
121
 
129
122
  def timeout_thread
130
123
  Thread.new do
131
- sleep timeout
124
+ # Doing one long `sleep timeout` seems to fail sometimes, so
125
+ # we do a series of short timeouts before exiting
126
+ start_time = Time.now
127
+ loop do
128
+ sleep 10
129
+ duration = Time.now - start_time
130
+ break if duration >= timeout
131
+ end
132
+
132
133
  @timed_out = true
133
134
  reap_running_container
134
- end
135
+ end.run
135
136
  end
136
137
 
137
138
  def check_output_bytes(last_read_byte_count)
@@ -106,16 +106,16 @@ module CC
106
106
  end
107
107
 
108
108
  def run_tests
109
- Dir["**/*"].each do |test_file|
110
- next unless File.file?(test_file)
111
- process_file(test_file)
109
+ Dir["*"].each do |file|
110
+ next unless File.directory?(file)
111
+ process_directory(file)
112
112
  end
113
113
  end
114
114
 
115
- def process_file(test_file)
116
- markers = markers_in(test_file)
115
+ def process_directory(test_directory)
116
+ markers = markers_in(test_directory)
117
117
 
118
- actual_issues = issues_in(test_file)
118
+ actual_issues = issues_in(test_directory)
119
119
  compare_issues(actual_issues, markers)
120
120
  end
121
121
 
@@ -176,9 +176,9 @@ module CC
176
176
  end
177
177
  end
178
178
 
179
- def issues_in(test_file)
179
+ def issues_in(test_directory)
180
180
  issue_docs = capture_stdout do
181
- codeclimate_analyze(test_file)
181
+ codeclimate_analyze(test_directory)
182
182
  end
183
183
 
184
184
  JSON.parse(issue_docs)
@@ -206,13 +206,16 @@ module CC
206
206
  end
207
207
  end
208
208
 
209
- def markers_in(test_file)
210
- lines = File.readlines(test_file)
211
-
209
+ def markers_in(test_directory)
212
210
  [].tap do |markers|
213
- lines.each_with_index do |line, index|
214
- if line =~ /\[issue\].*/
215
- markers << Marker.from_text(@engine_name, test_file, index + 1, line)
211
+ Dir[File.join(test_directory, "**/*")].each do |file|
212
+ next unless File.file?(file)
213
+ lines = File.readlines(file)
214
+
215
+ lines.each_with_index do |line, index|
216
+ if line =~ /\[issue\].*/
217
+ markers << Marker.from_text(@engine_name, file, index + 1, line)
218
+ end
216
219
  end
217
220
  end
218
221
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codeclimate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.4
4
+ version: 0.14.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code Climate
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-20 00:00:00.000000000 Z
11
+ date: 2015-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport