Skip to content

Commit 9101f32

Browse files
committed
Fail on invalid eol setting
1 parent f43743b commit 9101f32

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

config/default.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ PreCommit:
632632
LineEndings:
633633
description: 'Check line endings'
634634
enabled: false
635-
eol: "\n"
635+
eol: "\n" # or "\r\n" for Windows-style newlines
636636

637637
XmlLint:
638638
enabled: false

lib/overcommit/hook/pre_commit/line_endings.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ def eol
4545
'lf'
4646
when "\r\n"
4747
'crlf'
48+
else
49+
raise 'Invalid `eol` option specified: must be "\n" or "\r\n"'
4850
end
4951
end
5052
end

0 commit comments

Comments
 (0)