-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.py
More file actions
42 lines (33 loc) · 823 Bytes
/
Copy pathcommon.py
File metadata and controls
42 lines (33 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"""
Common variable and method module.
"""
import re
class Common:
"""
Singleton storage for variables used during comparison.
"""
# values from argument parser
args = None
# original repository
original = None
# compared repository
new = None
# references to be checked
references = None
# mapping of commits
commits = {}
# message refusal regex
reject_msg_regex = None
# blob mapping and info
blobs = {}
blobs_info = {}
# issues collected along the way
issues = []
@classmethod
def add_issue(cls, msg, detail=""):
cls.issues.append((msg, detail))
@classmethod
def compile_args(cls, args):
cls.args = args
if cls.args.reject_msg:
cls.reject_msg_regex = re.compile(args.reject_msg)