Skip to content

Commit fa3038e

Browse files
committed
Format files to pass CI checks
1 parent 70ae6ad commit fa3038e

File tree

6 files changed

+104
-98
lines changed

6 files changed

+104
-98
lines changed

ci/tizen/check-symbol.py

Lines changed: 59 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -9,74 +9,76 @@
99

1010

1111
class Symbol:
12-
def __init__(self, addr, type, name):
13-
self.addr = addr
14-
self.type = type
15-
self.name = name
1612

17-
def __str__(self):
18-
return '{} {} {}'.format(self.addr, self.type, self.name)
13+
def __init__(self, addr, type, name):
14+
self.addr = addr
15+
self.type = type
16+
self.name = name
1917

20-
@staticmethod
21-
def parse(line):
22-
return Symbol(line[:8].strip(), line[9], line[11:].strip())
18+
def __str__(self):
19+
return '{} {} {}'.format(self.addr, self.type, self.name)
20+
21+
@staticmethod
22+
def parse(line):
23+
return Symbol(line[:8].strip(), line[9], line[11:].strip())
2324

2425

2526
def check_symbol(sofile, allowlist):
26-
if not os.access(sofile, os.R_OK):
27-
raise Exception('{} is not readable'.format(sofile))
28-
if not os.access(allowlist, os.R_OK):
29-
raise Exception('{} is not readable'.format(allowlist))
30-
31-
try:
32-
symbols_raw = subprocess.check_output(
33-
['nm', '-gDC', sofile]).decode('utf-8').splitlines()
34-
symbols = [Symbol.parse(line) for line in symbols_raw]
35-
except subprocess.CalledProcessError as e:
36-
raise Exception('nm failed: {}'.format(e))
37-
38-
with open(allowlist, 'r') as f:
39-
allowlist = [line.strip() for line in f.readlines()]
40-
41-
not_allowed = []
42-
for symbol in symbols:
43-
if symbol.addr:
44-
continue
45-
if symbol.name.startswith('FlutterEngine'):
46-
continue
47-
if symbol.name in allowlist:
48-
continue
49-
not_allowed.append(symbol)
50-
51-
if not_allowed:
52-
print('Symbols not allowed ({}):'.format(sofile))
53-
for symbol in not_allowed:
54-
print(symbol)
55-
return False
56-
57-
return True
27+
if not os.access(sofile, os.R_OK):
28+
raise Exception('{} is not readable'.format(sofile))
29+
if not os.access(allowlist, os.R_OK):
30+
raise Exception('{} is not readable'.format(allowlist))
31+
32+
try:
33+
symbols_raw = subprocess.check_output(['nm', '-gDC',
34+
sofile]).decode('utf-8').splitlines()
35+
symbols = [Symbol.parse(line) for line in symbols_raw]
36+
except subprocess.CalledProcessError as e:
37+
raise Exception('nm failed: {}'.format(e))
38+
39+
with open(allowlist, 'r') as f:
40+
allowlist = [line.strip() for line in f.readlines()]
41+
42+
not_allowed = []
43+
for symbol in symbols:
44+
if symbol.addr:
45+
continue
46+
if symbol.name.startswith('FlutterEngine'):
47+
continue
48+
if symbol.name in allowlist:
49+
continue
50+
not_allowed.append(symbol)
51+
52+
if not_allowed:
53+
print('Symbols not allowed ({}):'.format(sofile))
54+
for symbol in not_allowed:
55+
print(symbol)
56+
return False
57+
58+
return True
5859

5960

6061
def main():
61-
import optparse
62-
parser = optparse.OptionParser(usage='%prog [options] [sofile ..]')
63-
parser.add_option('--allowlist', dest='allowlist',
64-
help='Path to the allowlist file')
65-
(options, args) = parser.parse_args()
62+
import optparse
63+
parser = optparse.OptionParser(usage='%prog [options] [sofile ..]')
64+
parser.add_option(
65+
'--allowlist', dest='allowlist', help='Path to the allowlist file'
66+
)
67+
(options, args) = parser.parse_args()
6668

67-
if not options.allowlist:
68-
print('--allowlist is required')
69-
return 1
70-
if not args:
71-
print('sofile is required')
72-
return 1
69+
if not options.allowlist:
70+
print('--allowlist is required')
71+
return 1
72+
if not args:
73+
print('sofile is required')
74+
return 1
7375

74-
for sofile in args:
75-
if not check_symbol(sofile, options.allowlist):
76-
return 1
76+
for sofile in args:
77+
if not check_symbol(sofile, options.allowlist):
78+
return 1
7779

78-
return 0
80+
return 0
7981

8082

8183
if __name__ == '__main__':
82-
sys.exit(main())
84+
sys.exit(main())

ci/tizen/gclient-shallow-sync.py

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,56 +10,58 @@
1010

1111

1212
def run_git(args, cwd):
13-
if not args:
14-
raise Exception('Please provide a git command to run.')
15-
return subprocess.call(['git'] + args, cwd=cwd) == 0
13+
if not args:
14+
raise Exception('Please provide a git command to run.')
15+
return subprocess.call(['git'] + args, cwd=cwd) == 0
1616

1717

1818
def checkout_shallow_git(path, url, revision):
19-
"""Checks out a shallow reference, then sets the expected branch to be
19+
"""Checks out a shallow reference, then sets the expected branch to be
2020
checked out."""
2121

22-
os.makedirs(path, exist_ok=True)
23-
run_git(['init', '--quiet'], path)
24-
run_git(['config', 'advice.detachedHead', 'false'], path)
25-
run_git(['remote', 'add', 'origin', url], path)
26-
run_git(['fetch', '--depth', '1', 'origin', revision], path)
27-
run_git(['checkout', 'FETCH_HEAD'], path)
22+
os.makedirs(path, exist_ok=True)
23+
run_git(['init', '--quiet'], path)
24+
run_git(['config', 'advice.detachedHead', 'false'], path)
25+
run_git(['remote', 'add', 'origin', url], path)
26+
run_git(['fetch', '--depth', '1', 'origin', revision], path)
27+
run_git(['checkout', 'FETCH_HEAD'], path)
2828

2929

3030
def checkout_deps(deps):
31-
"""Checks out the shallow refs specified in the DEPS file."""
32-
with concurrent.futures.ThreadPoolExecutor(max_workers=8) as executor:
33-
futures = []
34-
for deps_name, deps_data in deps.items():
35-
if deps_data.get('dep_type') == 'git':
36-
url = deps_data['url'].split('@')[0]
37-
revision = deps_data['url'].split('@')[1]
38-
futures.append(executor.submit(
39-
checkout_shallow_git, deps_name, url, revision))
40-
for future in concurrent.futures.as_completed(futures):
41-
future.result()
31+
"""Checks out the shallow refs specified in the DEPS file."""
32+
with concurrent.futures.ThreadPoolExecutor(max_workers=8) as executor:
33+
futures = []
34+
for deps_name, deps_data in deps.items():
35+
if deps_data.get('dep_type') == 'git':
36+
url = deps_data['url'].split('@')[0]
37+
revision = deps_data['url'].split('@')[1]
38+
futures.append(
39+
executor.submit(checkout_shallow_git, deps_name, url, revision)
40+
)
41+
for future in concurrent.futures.as_completed(futures):
42+
future.result()
4243

4344

4445
def main(argv):
45-
if (len(argv) < 1):
46-
raise Exception('Please provide a DEPS file to update.')
47-
deps_file = argv[0]
48-
if not os.path.exists(deps_file):
49-
raise Exception('The DEPS file does not exist.')
46+
if (len(argv) < 1):
47+
raise Exception('Please provide a DEPS file to update.')
48+
deps_file = argv[0]
49+
if not os.path.exists(deps_file):
50+
raise Exception('The DEPS file does not exist.')
5051

51-
host_os = 'linux'
52-
if platform.system() == 'Windows':
53-
host_os = 'win'
54-
if platform.system() == 'Darwin':
55-
host_os = 'mac'
52+
host_os = 'linux'
53+
if platform.system() == 'Windows':
54+
host_os = 'win'
55+
if platform.system() == 'Darwin':
56+
host_os = 'mac'
5657

57-
deps_contents = gclient_utils.FileRead(deps_file)
58-
local_scope = gclient_eval.Parse(
59-
deps_contents, deps_file, builtin_vars={'host_os': host_os})
58+
deps_contents = gclient_utils.FileRead(deps_file)
59+
local_scope = gclient_eval.Parse(
60+
deps_contents, deps_file, builtin_vars={'host_os': host_os}
61+
)
6062

61-
checkout_deps(local_scope['deps'])
63+
checkout_deps(local_scope['deps'])
6264

6365

6466
if '__main__' == __name__:
65-
sys.exit(main(sys.argv[1:]))
67+
sys.exit(main(sys.argv[1:]))

shell/platform/embedder/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ shared_library("flutter_engine_library") {
374374
[ "-Wl,--version-script=" + rebase_path("flutter_engine_exports.lst") ]
375375

376376
if (is_mac && !embedder_for_target) {
377-
ldflags = [ "-Wl,-install_name,@rpath/FlutterEmbedder.framework/$_framework_binary_subpath" ]
377+
ldflags += [ "-Wl,-install_name,@rpath/FlutterEmbedder.framework/$_framework_binary_subpath" ]
378378
}
379379

380380
deps = [ ":embedder" ]

shell/platform/tizen/tizen_input_method_context.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ const char* GetEcoreImfContextAvailableId() {
1414
modules = ecore_imf_context_available_ids_get();
1515
if (modules) {
1616
void* module;
17-
EINA_LIST_FREE(modules, module) { return static_cast<const char*>(module); }
17+
EINA_LIST_FREE(modules, module) {
18+
return static_cast<const char*>(module);
19+
}
1820
}
1921
return nullptr;
2022
}

third_party/accessibility/ax/platform/atk_util_auralinux_gtk.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include <atk-bridge.h>
66

7-
//#include "base/environment.h"
7+
// #include "base/environment.h"
88
#include "atk_util_auralinux.h"
99

1010
namespace ui {

tools/gn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,8 @@ def to_gn_args(args):
504504

505505
# Enable pointer compression on 64-bit mobile targets. iOS is excluded due to
506506
# its inability to allocate address space without allocating memory.
507-
if args.target_os in ['android', 'linux'] and gn_args['target_cpu'] in ['x64', 'arm64'
508-
]:
507+
if args.target_os in ['android', 'linux'
508+
] and gn_args['target_cpu'] in ['x64', 'arm64']:
509509
gn_args['dart_use_compressed_pointers'] = True
510510

511511
if args.fuchsia_target_api_level is not None:

0 commit comments

Comments
 (0)