1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 02:33:06 +01:00

[Utils] Fix indentation error in utils/wciia.py

Running this script gives
```
"llvm-project/llvm/./utils/wciia.py", line 56
    if word == "N:":
TabError: inconsistent use of tabs and spaces in indentation
```
Under emacs' whitespace-mode, it shows
```
for·line·in·code_owners_file:$
····for·word·in·line.split():$
»       if·word·==·"N:":$
»       »       name·=·line[2:].strip()$
»       »       if·code_owner:$
»       »       »       process_code_owner(code_owner)$
»       »       »       code_owner·=·{}$
```
I use `yapf` to format this script directly and it's running correctly.
This commit is contained in:
Kai Luo 2021-05-16 22:34:09 +08:00
parent 945b8d0f5d
commit f5ce33b9fe

View File

@ -1,5 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python
""" """
wciia - Whose Code Is It Anyway wciia - Whose Code Is It Anyway
@ -25,6 +24,7 @@ import os
code_owners = {} code_owners = {}
def process_files_and_folders(owner): def process_files_and_folders(owner):
filesfolders = owner['filesfolders'] filesfolders = owner['filesfolders']
# paths must be in ( ... ) so strip them # paths must be in ( ... ) so strip them
@ -39,6 +39,7 @@ def process_files_and_folders(owner):
for path in paths.split(): for path in paths.split():
owner['paths'].append(path) owner['paths'].append(path)
def process_code_owner(owner): def process_code_owner(owner):
if 'filesfolders' in owner: if 'filesfolders' in owner:
filesfolders = owner['filesfolders'] filesfolders = owner['filesfolders']
@ -48,6 +49,7 @@ def process_code_owner(owner):
process_files_and_folders(owner) process_files_and_folders(owner)
code_owners[owner['name']] = owner code_owners[owner['name']] = owner
# process CODE_OWNERS.TXT first # process CODE_OWNERS.TXT first
code_owners_file = open("CODE_OWNERS.TXT", "r").readlines() code_owners_file = open("CODE_OWNERS.TXT", "r").readlines()
code_owner = {} code_owner = {}
@ -70,6 +72,7 @@ for line in code_owners_file:
filesfolders = line[2:].strip() filesfolders = line[2:].strip()
code_owner['filesfolders'].append(filesfolders) code_owner['filesfolders'].append(filesfolders)
def find_owners(fpath): def find_owners(fpath):
onames = [] onames = []
lmatch = -1 lmatch = -1
@ -94,6 +97,7 @@ def find_owners(fpath):
onames.append('Chris Lattner') onames.append('Chris Lattner')
return onames return onames
# now lest try to find the owner of the file or folder # now lest try to find the owner of the file or folder
import sys import sys