lib/onceover/codequality/syntax.rb in onceover-codequality-0.5.1 vs lib/onceover/codequality/syntax.rb in onceover-codequality-0.5.2
- old
+ new
@@ -42,10 +42,10 @@
# would parse only the foo key in ruby, throwing away the baz key due to
# a perceived negative indent, whereas python would tell you to fix the
# file and make it consistent. This is yaml implementation dependent but
# users would be advised to fix the file, so lets _also_ validate yaml
# files with python if available on our path...
- if system("python --version", :err => File::NULL)
+ if system("python --version && python -c 'import yaml'", :err => File::NULL)
logger.info("Running additional python YAML validation")
script = File.join(File.dirname(File.expand_path(__FILE__)), "../../../res/validate_yaml.py")
output, s = Open3.capture2e("python #{script}")
ok = s.exitstatus.zero?
status &= ok