Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 35a78c0 commit 7b491c7Copy full SHA for 7b491c7
1 file changed
pre_commit/commands/migrate_config.py
@@ -21,8 +21,10 @@ def _migrate_map(contents):
21
# Find the first non-header line
22
lines = contents.splitlines(True)
23
i = 0
24
- while _is_header_line(lines[i]):
25
- i += 1
+ # Only loop on non empty configuration file
+ if i < len(lines):
26
+ while _is_header_line(lines[i]):
27
+ i += 1
28
29
header = ''.join(lines[:i])
30
rest = ''.join(lines[i:])
0 commit comments