Skip to content

Commit 1921373

Browse files
committed
Fixed a lot of structural issues with the project
1 parent 3d2269d commit 1921373

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ First you will need to setup [pre-commit](https://pre-commit.com/) using their d
1313
rev: v0.3.1
1414
hooks:
1515
- id: commit-msg-hook
16-
args: [--pattern='[A-Z]{3,4}-[0-9]{3,6} \| [\w\s]* \| .+']
16+
args: [--pattern='[A-Z]{3,4}-[0-9]{3,6} \\| [\\w\\s]* \\| .+']
1717
stages: [commit-msg]
1818
```
1919

20-
#### To enable commit-msg hook with pre-commit run:
20+
**note the backslashes need to be escaped
21+
22+
### To enable commit-msg hook with pre-commit run:
2123
`pre-commit install --hook-type commit-msg`
2224

23-
#### Update to the latest release (optional)
25+
### Update to the latest release (optional)
2426
`pre-commit autoupdate --repo https://github.com/dtaivpp/commit-msg-regex-hook.git`

setup.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = commit-msg-regex-hook
3-
version = v0.0.3
3+
version = v0.0.4
44
author = David Tippett
55
description = Checks if commit message matches supplied regex
66
long_description = file: README.md
@@ -21,9 +21,9 @@ python_requires = >=3.6
2121

2222
[options.packages.find]
2323
where = src
24-
exclude = src.test
24+
exclude = test
2525

2626

2727
[options.entry_points]
2828
console_scripts =
29-
commit-msg-hook = main.cli:main
29+
commit-msg-regex-hook = src.commit_msg_regex_hook:main

src/__init__.py

Whitespace-only changes.
File renamed without changes.

src/main/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/__init__.py

Whitespace-only changes.
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
import re
22
import unittest
3-
import unittest
4-
from src.main import cli
3+
from src import commit_msg_regex_hook
54

65

76
class TestMessageEmpty(unittest.TestCase):
87
def test_empty_message_should_fail(self):
9-
result = cli.message_not_empty(" \n")()
8+
result = commit_msg_regex_hook.message_not_empty(" \n")()
109
self.assertEqual(result.is_passing(), False)
1110

1211
def test_full_message_should_pass(self):
13-
result = cli.message_not_empty("I am a whole message")()
12+
result = commit_msg_regex_hook.message_not_empty("I am a whole message")()
1413
self.assertEqual(result.is_passing(), True)
1514

1615

1716
class TestMessagePatternMatch(unittest.TestCase):
1817
def test_pattern_not_match(self):
1918
pattern = re.compile(r'[A-Z]{3,4}-[0-9]{3,6} \| [\w\s]* \| .+')
2019
test_str = "asefagrragadsrgasr"
21-
result = cli.message_pattern_match(test_str, pattern)()
20+
result = commit_msg_regex_hook.message_pattern_match(test_str, pattern)()
2221
self.assertEqual(result.is_passing(), False)
2322

2423
def test_pattern_match(self):
2524
pattern = re.compile(r'[A-Z]{3,4}-[0-9]{3,6} \| [\w\s]* \| .+')
2625
test_str = "ABC-123 | David | Commit message!"
27-
result = cli.message_pattern_match(test_str, pattern)()
26+
result = commit_msg_regex_hook.message_pattern_match(test_str, pattern)()
2827
self.assertEqual(result.is_passing(), True)

0 commit comments

Comments
 (0)