sds/overcommit · error · RuntimeError

Invalid `eol` option specified: must be "\n" or "\r\n"

Error message

Invalid `eol` option specified: must be "\n" or "\r\n"

What it means

Error "Invalid `eol` option specified: must be "\n" or "\r\n"" thrown in sds/overcommit.

Source

Thrown at lib/overcommit/hook/pre_commit/line_endings.rb:74

      result.stdout.split("\0").map do |file_info|
        info, path = file_info.split("\t")
        i = info.split.first
        next if i == 'l/-text' # ignore binary files
        next if i == "l/#{eol}"

        path
      end.compact
    end

    def eol
      @eol ||=  case config['eol']
                when "\n"
                  'lf'
                when "\r\n"
                  'crlf'
                else
                  raise 'Invalid `eol` option specified: must be "\n" or "\r\n"'
                end
    end
  end
end

View on GitHub (pinned to fee0cd74b2)

Solutions

  1. Set the hook's `eol` option in .overcommit.yml to either "\n" (LF) or "\r\n" (CRLF).
  2. Remove the `eol` option to use the hook's default line-ending enforcement.

When it happens

Trigger: Thrown at lib/overcommit/hook/pre_commit/line_endings.rb:74 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sds/overcommit@fee0cd74b2 (2026-08-23). Data as JSON: /api/errors/ad17d7b89ddd65c1. Report an issue: GitHub.