12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/rubocop/gradual/serializer.rb', line 12
def deserialize(data)
files = JSON.parse(data).map do |key, value|
path, hash = key.split(":")
raise Error, "Wrong format of the lock file: `#{key}` must include hash" if hash.nil? || hash.empty?
issues = value.map do |line, column, length, message, issue_hash|
{ line: line, column: column, length: length, message: message, hash: issue_hash }
end
{ path: path, hash: hash.to_i, issues: issues }
end
Results.new(files: files)
end
|