Commit 88ee5f5c authored by Camillo Bruni's avatar Camillo Bruni Committed by V8 LUCI CQ

[tools] Fix list_depreceated.py

- More compact output
- Fix off-by-one for deprecation messages

Bug: v8:11165
Change-Id: I35e89e9496b4306ed0c692bde321d33c4bc1cd97
No-Try: True
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3245119
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: 's avatarVictor Gomes <victorgomes@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77548}
parent 2c791ece
...@@ -120,7 +120,7 @@ class HeaderFile(object): ...@@ -120,7 +120,7 @@ class HeaderFile(object):
parens = parens - 1 parens = parens - 1
if parens == 0: if parens == 0:
# Exclude closing ") # Exclude closing ")
pos = pos - 2 pos = pos - 1
break break
elif line[pos] == '"' and start == -1: elif line[pos] == '"' and start == -1:
start = pos + 1 start = pos + 1
...@@ -132,9 +132,10 @@ class HeaderFile(object): ...@@ -132,9 +132,10 @@ class HeaderFile(object):
if len(deprecated) == 0: return if len(deprecated) == 0: return
for linenumber, commit_datetime, commit_hash, content in deprecated: for linenumber, commit_datetime, commit_hash, content in deprecated:
commit_date = commit_datetime.date() commit_date = commit_datetime.date()
file_position = (f"{self.path}:{linenumber}").rjust(40) file_position = (f"{self.path}:{linenumber}").ljust(40)
print(f" {file_position}\t{commit_date}\t{commit_hash[:8]}" v8_version = self.extract_version(commit_hash)
f"\t{self.extract_version(commit_hash)}\t{content}") print(f"{file_position} v{v8_version} {commit_date} {commit_hash[:8]}"
f" {content}")
return len(deprecated) return len(deprecated)
...@@ -163,11 +164,11 @@ def parse_options(args): ...@@ -163,11 +164,11 @@ def parse_options(args):
def main(args): def main(args):
options = parse_options(args) options = parse_options(args)
header_files = HeaderFile.get_api_header_files(options) header_files = HeaderFile.get_api_header_files(options)
print("V8_DEPRECATE_SOON:") print("# V8_DEPRECATE_SOON:")
for header in header_files: for header in header_files:
header.filter_and_print("V8_DEPRECATE_SOON", options) header.filter_and_print("V8_DEPRECATE_SOON", options)
print("\n") print("\n")
print("V8_DEPRECATED:") print("# V8_DEPRECATED:")
for header in header_files: for header in header_files:
header.filter_and_print("V8_DEPRECATED", options) header.filter_and_print("V8_DEPRECATED", options)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment