mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-29 00:21:14 +00:00
[clang-tidy] Rename qualified references to check class + support inconsistent names
llvm-svn: 319062
This commit is contained in:
parent
a8efe6d9a5
commit
1f71b91254
@ -184,12 +184,19 @@ def main():
|
||||
help='Old check name.')
|
||||
parser.add_argument('new_check_name', type=str,
|
||||
help='New check name.')
|
||||
parser.add_argument('--check_class_name', type=str,
|
||||
help='Old name of the class implementing the check.')
|
||||
args = parser.parse_args()
|
||||
|
||||
old_module = args.old_check_name.split('-')[0]
|
||||
new_module = args.new_check_name.split('-')[0]
|
||||
check_name_camel = ''.join(map(lambda elem: elem.capitalize(),
|
||||
args.old_check_name.split('-')[1:])) + 'Check'
|
||||
if args.check_class_name:
|
||||
check_name_camel = args.check_class_name
|
||||
else:
|
||||
check_name_camel = (''.join(map(lambda elem: elem.capitalize(),
|
||||
args.old_check_name.split('-')[1:])) +
|
||||
'Check')
|
||||
|
||||
new_check_name_camel = (''.join(map(lambda elem: elem.capitalize(),
|
||||
args.new_check_name.split('-')[1:])) +
|
||||
'Check')
|
||||
@ -237,6 +244,10 @@ def main():
|
||||
args.new_check_name + '\n' + '=' * len(args.new_check_name) + '\n')
|
||||
|
||||
replaceInFile(filename, args.old_check_name, args.new_check_name)
|
||||
replaceInFile(filename, old_module + '::' + check_name_camel,
|
||||
new_module + '::' + new_check_name_camel)
|
||||
replaceInFile(filename, old_module + '/' + check_name_camel,
|
||||
new_module + '/' + new_check_name_camel)
|
||||
replaceInFile(filename, check_name_camel, new_check_name_camel)
|
||||
|
||||
if old_module != new_module:
|
||||
|
Loading…
Reference in New Issue
Block a user