Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conventional_pre_commit/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def r_types(self):
@property
def r_scope(self):
"""Regex str for an optional (scope)."""
escaped_delimiters = list(map(re.escape, [":", ",", "-", "/", "."])) # type: ignore
escaped_delimiters = list(map(re.escape, [":", ",", "-", "/", ".", "#"])) # type: ignore
if self.scopes:
scopes = self._r_or(self.scopes)
delimiters_pattern = self._r_or(escaped_delimiters)
Expand Down
7 changes: 7 additions & 0 deletions tests/test_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ def test_r_scope__special_chars(conventional_commit_scope_required):
assert regex.match("(some:thing)")
assert regex.match("(some,thing)")
assert regex.match("(some.thing)")
assert regex.match("(some#thing)")


def test_r_scope__scopes(conventional_commit_scope_required):
Expand Down Expand Up @@ -649,6 +650,12 @@ def test_is_valid__with_scope(conventional_commit):
assert conventional_commit.is_valid(input)


def test_is_valid__with_scope_and_hash(conventional_commit):
input = "feat(#scope): message"

assert conventional_commit.is_valid(input)


def test_is_valid__body_multiline_body_bad_type(conventional_commit):
input = """wrong: message

Expand Down
Loading