summaryrefslogtreecommitdiff
path: root/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'util.py')
-rw-r--r--util.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/util.py b/util.py
index bd916df..76cb182 100644
--- a/util.py
+++ b/util.py
@@ -1,6 +1,7 @@
import logging
import re
+
class Logger():
_instance = None
@@ -29,9 +30,16 @@ def first(iterable, condition=lambda x: True):
except StopIteration:
return None
+
def getProjRepoName(arg):
id_, name, projNum, *_ = arg
eng = re.sub('[\u4e00-\u9fa5]', '', name)
- eng = ''.join(
- [word[0].capitalize() + word[1:] for word in eng.split()])
- return f"{eng}{id_}-p{projNum}" \ No newline at end of file
+ eng = ''.join([word[0].capitalize() + word[1:] for word in eng.split()])
+ return f"{eng}{id_}-p{projNum}"
+
+
+def passCodeQuality(path, language):
+ with open(path, encoding='utf-8', errors='replace') as f:
+ res = f.read()
+ if language == "matlab":
+ return "global " not in res \ No newline at end of file