Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 619dfe8

Browse files
committed
pylint scripts under sky, remove dead scripts under sky/tools/roll
1 parent 8915b81 commit 619dfe8

File tree

12 files changed

+37
-320
lines changed

12 files changed

+37
-320
lines changed

ci/licenses_golden/licenses_flutter

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5567,7 +5567,6 @@ FILE: ../../../flutter/shell/profiling/sampling_profiler.h
55675567
FILE: ../../../flutter/shell/version/version.cc
55685568
FILE: ../../../flutter/shell/version/version.h
55695569
FILE: ../../../flutter/shell/vmservice/empty.dart
5570-
FILE: ../../../flutter/sky/tools/roll/patches/chromium/android_build.patch
55715570
FILE: ../../../flutter/third_party/accessibility/base/color_utils.h
55725571
FILE: ../../../flutter/third_party/accessibility/base/compiler_specific.h
55735572
FILE: ../../../flutter/third_party/accessibility/base/container_utils.h

ci/lint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ pylint-2.7 --rcfile=.pylintrc \
7474
"build/" \
7575
"ci/" \
7676
"impeller/" \
77+
"sky/" \
7778
"tools/gn" \
7879
"testing/"
7980

sky/tools/create_full_ios_framework.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import subprocess
1414
import sys
1515

16-
from create_xcframework import create_xcframework
16+
from create_xcframework import create_xcframework # pylint: disable=import-error
1717

1818
DSYMUTIL = os.path.join(
1919
os.path.dirname(__file__), '..', '..', '..', 'buildtools', 'mac-x64',
@@ -39,8 +39,8 @@ def main():
3939
parser.add_argument('--arm64-out-dir', type=str, required=True)
4040
parser.add_argument('--simulator-x64-out-dir', type=str, required=True)
4141
parser.add_argument('--simulator-arm64-out-dir', type=str, required=False)
42-
parser.add_argument('--strip', action="store_true", default=False)
43-
parser.add_argument('--dsym', action="store_true", default=False)
42+
parser.add_argument('--strip', action='store_true', default=False)
43+
parser.add_argument('--dsym', action='store_true', default=False)
4444

4545
args = parser.parse_args()
4646

@@ -108,9 +108,10 @@ def main():
108108
process_framework(args, dst, framework, framework_binary)
109109
generate_gen_snapshot(args, dst, x64_out_dir, arm64_out_dir)
110110
zip_archive(dst)
111+
return 0
111112

112113

113-
def create_framework(
114+
def create_framework( # pylint: disable=too-many-arguments
114115
args, dst, framework, arm64_framework, simulator_framework,
115116
simulator_x64_framework, simulator_arm64_framework
116117
):
@@ -122,7 +123,7 @@ def create_framework(
122123
return 1
123124

124125
if not os.path.isfile(simulator_x64_dylib):
125-
print('Cannot find iOS simulator dylib at %s' % simulator_dylib)
126+
print('Cannot find iOS simulator dylib at %s' % simulator_x64_dylib)
126127
return 1
127128

128129
shutil.rmtree(framework, True)
@@ -143,12 +144,12 @@ def create_framework(
143144
process_framework(
144145
args, dst, simulator_framework, simulator_framework_binary
145146
)
146-
simulator_framework = simulator_framework
147147
else:
148148
simulator_framework = simulator_x64_framework
149149

150-
# Create XCFramework from the arm-only fat framework and the arm64/x64 simulator frameworks, or just the
151-
# x64 simulator framework if only that one exists.
150+
# Create XCFramework from the arm-only fat framework and the arm64/x64
151+
# simulator frameworks, or just the x64 simulator framework if only that one
152+
# exists.
152153
xcframeworks = [simulator_framework, framework]
153154
create_xcframework(location=dst, name='Flutter', frameworks=xcframeworks)
154155

@@ -158,10 +159,12 @@ def create_framework(
158159
framework_binary
159160
])
160161

162+
return 0
163+
161164

162165
def embed_codesign_configuration(config_path, contents):
163-
with open(config_path, 'w') as f:
164-
f.write('\n'.join(contents) + '\n')
166+
with open(config_path, 'w') as file:
167+
file.write('\n'.join(contents) + '\n')
165168

166169

167170
def zip_archive(dst):
@@ -189,7 +192,7 @@ def zip_archive(dst):
189192
'without_entitlements.txt',
190193
],
191194
cwd=dst)
192-
if (os.path.exists(os.path.join(dst, 'Flutter.dSYM'))):
195+
if os.path.exists(os.path.join(dst, 'Flutter.dSYM')):
193196
subprocess.check_call(['zip', '-r', 'Flutter.dSYM.zip', 'Flutter.dSYM'],
194197
cwd=dst)
195198

@@ -204,7 +207,7 @@ def process_framework(args, dst, framework, framework_binary):
204207
unstripped_out = os.path.join(dst, 'Flutter.unstripped')
205208
shutil.copyfile(framework_binary, unstripped_out)
206209

207-
subprocess.check_call(["strip", "-x", "-S", framework_binary])
210+
subprocess.check_call(['strip', '-x', '-S', framework_binary])
208211

209212

210213
def generate_gen_snapshot(args, dst, x64_out_dir, arm64_out_dir):

sky/tools/create_ios_framework.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import sys
1111
import os
1212

13-
from create_xcframework import create_xcframework
13+
from create_xcframework import create_xcframework # pylint: disable=import-error
1414

1515
DSYMUTIL = os.path.join(
1616
os.path.dirname(__file__), '..', '..', '..', 'buildtools', 'mac-x64',
@@ -31,8 +31,8 @@ def main():
3131
'--simulator-x64-out-dir', '--simulator-out-dir', type=str, required=True
3232
)
3333
parser.add_argument('--simulator-arm64-out-dir', type=str, required=False)
34-
parser.add_argument('--strip', action="store_true", default=False)
35-
parser.add_argument('--dsym', action="store_true", default=False)
34+
parser.add_argument('--strip', action='store_true', default=False)
35+
parser.add_argument('--dsym', action='store_true', default=False)
3636

3737
args = parser.parse_args()
3838

@@ -64,7 +64,7 @@ def main():
6464
return 1
6565

6666
if not os.path.isfile(simulator_x64_dylib):
67-
print('Cannot find iOS simulator dylib at %s' % simulator_dylib)
67+
print('Cannot find iOS simulator dylib at %s' % simulator_x64_dylib)
6868
return 1
6969

7070
if not os.path.isfile(DSYMUTIL):
@@ -88,12 +88,12 @@ def main():
8888
'-output', simulator_framework_binary
8989
])
9090
process_framework(args, simulator_framework, simulator_framework_binary)
91-
simulator_framework = simulator_framework
9291
else:
9392
simulator_framework = simulator_x64_framework
9493

95-
# Create XCFramework from the arm-only fat framework and the arm64/x64 simulator frameworks, or just the
96-
# x64 simulator framework if only that one exists.
94+
# Create XCFramework from the arm-only fat framework and the arm64/x64
95+
# simulator frameworks, or just the x64 simulator framework if only that one
96+
# exists.
9797
xcframeworks = [simulator_framework, framework]
9898
create_xcframework(location=args.dst, name='Flutter', frameworks=xcframeworks)
9999

@@ -104,6 +104,7 @@ def main():
104104
])
105105

106106
process_framework(args, framework, framework_binary)
107+
return 0
107108

108109

109110
def process_framework(args, framework, framework_binary):
@@ -116,7 +117,7 @@ def process_framework(args, framework, framework_binary):
116117
unstripped_out = os.path.join(args.dst, 'Flutter.unstripped')
117118
shutil.copyfile(framework_binary, unstripped_out)
118119

119-
subprocess.check_call(["strip", "-x", "-S", framework_binary])
120+
subprocess.check_call(['strip', '-x', '-S', framework_binary])
120121

121122

122123
if __name__ == '__main__':

sky/tools/create_macos_framework.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
import sys
1111
import os
1212

13-
from create_xcframework import create_xcframework
14-
1513
buildroot_dir = os.path.abspath(
1614
os.path.join(os.path.realpath(__file__), '..', '..', '..', '..')
1715
)
@@ -32,10 +30,10 @@ def main():
3230
parser.add_argument('--dst', type=str, required=True)
3331
parser.add_argument('--arm64-out-dir', type=str, required=True)
3432
parser.add_argument('--x64-out-dir', type=str, required=True)
35-
parser.add_argument('--strip', action="store_true", default=False)
36-
parser.add_argument('--dsym', action="store_true", default=False)
33+
parser.add_argument('--strip', action='store_true', default=False)
34+
parser.add_argument('--dsym', action='store_true', default=False)
3735
# TODO(godofredoc): Remove after recipes v2 have landed.
38-
parser.add_argument('--zip', action="store_true", default=False)
36+
parser.add_argument('--zip', action='store_true', default=False)
3937

4038
args = parser.parse_args()
4139

@@ -93,6 +91,8 @@ def main():
9391
])
9492
process_framework(dst, args, fat_framework, fat_framework_binary)
9593

94+
return 0
95+
9696

9797
def regenerate_symlinks(fat_framework):
9898
"""Regenerates the symlinks structure.
@@ -142,7 +142,7 @@ def process_framework(dst, args, fat_framework, fat_framework_binary):
142142
unstripped_out = os.path.join(dst, 'FlutterMacOS.unstripped')
143143
shutil.copyfile(fat_framework_binary, unstripped_out)
144144

145-
subprocess.check_call(["strip", "-x", "-S", fat_framework_binary])
145+
subprocess.check_call(['strip', '-x', '-S', fat_framework_binary])
146146

147147
# Zip FlutterMacOS.framework.
148148
if args.zip:

sky/tools/create_macos_gen_snapshots.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def main():
2424
parser.add_argument('--x64-out-dir', type=str)
2525
parser.add_argument('--arm64-out-dir', type=str)
2626
parser.add_argument('--armv7-out-dir', type=str)
27-
parser.add_argument('--zip', action="store_true", default=False)
27+
parser.add_argument('--zip', action='store_true', default=False)
2828

2929
args = parser.parse_args()
3030

sky/tools/create_xcframework.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
# found in the LICENSE file.
66

77
import argparse
8-
import errno
98
import os
109
import shutil
1110
import subprocess
@@ -46,7 +45,8 @@ def create_xcframework(location, name, frameworks):
4645
# Remove old xcframework.
4746
shutil.rmtree(output_xcframework)
4847

49-
# xcrun xcodebuild -create-xcframework -framework foo/baz.framework -framework bar/baz.framework -output output/
48+
# xcrun xcodebuild -create-xcframework -framework foo/baz.framework \
49+
# -framework bar/baz.framework -output output/
5050
command = ['xcrun', 'xcodebuild', '-quiet', '-create-xcframework']
5151

5252
for framework in frameworks:

sky/tools/install_framework_headers.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import errno
99
import os
1010
import shutil
11-
import subprocess
1211
import sys
1312

1413

@@ -31,10 +30,10 @@ def main():
3130
# Remove old headers.
3231
try:
3332
shutil.rmtree(os.path.normpath(args.location))
34-
except OSError as e:
33+
except OSError as err:
3534
# Ignore only "not found" errors.
36-
if e.errno != errno.ENOENT:
37-
raise e
35+
if err.errno != errno.ENOENT:
36+
raise err
3837

3938
# Create the directory to copy the files to.
4039
if not os.path.isdir(args.location):

sky/tools/roll/patch.py

Lines changed: 0 additions & 46 deletions
This file was deleted.

sky/tools/roll/patches/chromium/android_build.patch

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)