Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(ビルドログの解析スクリプト) 予約語の type と重複する変数名を使わないようにする #727

Merged
Merged
Changes from 1 commit
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
20 changes: 10 additions & 10 deletions parse-buildlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# 解析結果を格納するハッシュのキー
logHashKeys = [
'type',
'errtype',
'code',
'source',
'dest',
Expand All @@ -20,7 +20,7 @@
]

csvKeys = [
'type',
'errtype',
'code',
'source',
'dest',
Expand All @@ -31,7 +31,7 @@
]

excelKeys = [
'type',
'errtype',
'code',
'source',
'dest',
Expand All @@ -51,7 +51,7 @@ def parse_buildlog(infile):
regLineNumer = r'\((?P<lineNumber>\d+)\)'

# エラーコードに対する正規表現: 例 warning C4267
regError = r'\s*(?P<type>\w+)\s+(?P<code>\w+)\s*'
regError = r'\s*(?P<errtype>\w+)\s+(?P<code>\w+)\s*'

# エラーメッセージ: 例 'argument': conversion from 'size_t' to 'int', possible loss of data [C:\projects\sakura\sakura\sakura.vcxproj]
regMessage = r'(?P<message>.+)$'
Expand Down Expand Up @@ -80,12 +80,12 @@ def parse_buildlog(infile):
if match:
path = match.group('filePath')
lineNumber = match.group('lineNumber')
type = match.group('type')
errtype = match.group('errtype')
code = match.group('code')
message = match.group('message')

entry = {}
entry['type'] = type
entry['errtype'] = errtype
entry['code'] = code

match2 = re.search(regFromTo, text)
Expand Down Expand Up @@ -191,19 +191,19 @@ def converterPython2(value):
message = re.sub(r'((\S*)\)\s*)?\[(.+?)\]', r'', message)

# エラータイプ
type = entry['type']
errtype = entry['errtype']

# エラーコード
code = entry['code']

# サマリーを管理するハッシュ用のキー
errorKey = ' '.join([type, code, message])
errorKey = ' '.join([errtype, code, message])

if errorKey not in errorSummary:
errorSummary[errorKey] = {}
errorSummary[errorKey]["description"] = message
errorSummary[errorKey]["entries"] = []
errorSummary[errorKey]["type"] = type
errorSummary[errorKey]["errtype"] = errtype
errorSummary[errorKey]["code"] = code
errorSummary[errorKey]["entries"].append(entry)

Expand Down Expand Up @@ -257,7 +257,7 @@ def converterPython2(value):

message = errorSummary[errorKey]["description"]
entries = errorSummary[errorKey]["entries"]
type = errorSummary[errorKey]["type"]
errtype = errorSummary[errorKey]["errtype"]
code = errorSummary[errorKey]["code"]

wsError = wb.create_sheet()
Expand Down