Skip to content

Commit f5de2ef

Browse files
Ken KundertKen Kundert
authored andcommitted
allow empty lines in a patterns file
1 parent 542f586 commit f5de2ef

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

emborg/patterns.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,14 @@ def check_patterns(
112112
default_style = "sh"
113113
for pattern in patterns:
114114
pattern = pattern.strip()
115+
if not pattern:
116+
continue
115117
culprit = src
116118
codicil = repr(pattern)
117119
kind = pattern[0:1]
118120
arg = pattern[1:].lstrip()
119121
if not kind or not arg:
120-
raise Error(f"invalid pattern: ‘{pattern}’")
122+
raise Error(f"invalid pattern: ‘{pattern}’", culprit=culprit)
121123
if kind in ["", "#"]:
122124
continue # is comment
123125
if kind not in known_kinds:

emborg/shlib.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# shell-script-like things relatively easily in Python.
55

66
# License {{{1
7-
# Copyright (C) 2016-2024 Kenneth S. Kundert
7+
# Copyright (C) 2016-2025 Kenneth S. Kundert
88
#
99
# This program is free software: you can redistribute it and/or modify
1010
# it under the terms of the GNU General Public License as published by
@@ -19,8 +19,8 @@
1919
# You should have received a copy of the GNU General Public License
2020
# along with this program. If not, see [http://www.gnu.org/licenses/].
2121

22-
__version__ = "1.6"
23-
__released__ = "2023-05-18"
22+
__version__ = "1.7"
23+
__released__ = "2025-05-20"
2424

2525
# Imports {{{1
2626
try:

0 commit comments

Comments
 (0)