Skip to content

Commit 1be2457

Browse files
committed
Fix YamlSyntax to specify aliases option
1 parent c142cd2 commit 1be2457

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/overcommit/hook/pre_commit/yaml_syntax.rb

+7-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ def run
88

99
applicable_files.each do |file|
1010
begin
11-
YAML.load_file(file)
12-
rescue ArgumentError, Psych::SyntaxError => e
13-
messages << Overcommit::Hook::Message.new(:error, file, nil, e.message)
11+
YAML.load_file(file, aliases: true)
12+
rescue ArgumentError
13+
begin
14+
YAML.load_file(file)
15+
rescue ArgumentError, Psych::SyntaxError => e
16+
messages << Overcommit::Hook::Message.new(:error, file, nil, e.message)
17+
end
1418
end
1519
end
1620

0 commit comments

Comments
 (0)