cypher / git-ruby-syntax-check

Checks the syntax of all changed ruby files is valid before allowing a commit
MIT License
70 stars 16 forks source link

unexpected return (LocalJumpError) #9

Closed NielsKSchjoedt closed 9 years ago

NielsKSchjoedt commented 9 years ago

With the latest I get:

.git/hooks/pre-commit:50:in `block in <main>': unexpected return (LocalJumpError)
    from .git/hooks/pre-commit:46:in `each'
    from .git/hooks/pre-commit:46:in `<main>'
NielsKSchjoedt commented 9 years ago

I think it should be next rather than return?

changed_ruby_files.each do |file|
  next if not File.readable?(file)

  if file =~ /\.erb\z/
    next if skip_erb_files

    # Set trim mode to "-", just as Rails does
    cmd = [["erb", "-xT -", file].shelljoin, " | ", [compiler_ruby, "-wc"].shelljoin].join
  else
    cmd = [compiler_ruby, "-wc", file].shelljoin
  end
cypher commented 9 years ago

This should hopefully be fixed now thanks to @bauruine