@@ -92,6 +92,7 @@ components_path = re.compile(r'.*qml/Components.*')
9292skip_components_flickable_path = re.compile(r'.*qml/Components/Flickable.qml')
9393skip_components_listview_path = re.compile(r'.*qml/Components/ListView.qml')
9494skip_components_gridview_path = re.compile(r'.*qml/Components/GridView.qml')
95+skip_mocks_path = re.compile(r'.*tests/mocks.*')
9596
9697def scan_for_flickable_imports(file_path, component_pats, qtquick_pat, unitycomponents_pat):
9798 errors = []
@@ -162,15 +163,17 @@ try:
162163 found_bad_import = True
163164 if scan_for_bad_import(path, ubuntu_components_pat, [ubuntu_good_components_pat]):
164165 found_bad_import = True
166+ if skip_mocks_path.match(path) or \
167+ skip_components_flickable_path.match(path) or \
168+ skip_components_listview_path.match(path) or \
169+ skip_components_gridview_path.match(path):
170+ break
165171 if not components_path.match(path):
166172 if scan_for_flickable_imports(path, flickable_pats, quick_good_pat, unity_components_pat):
167173 found_bad_import = True
168174 else:
169− if not skip_components_flickable_path.match(path) and \
170− not skip_components_listview_path.match(path) and \
171− not skip_components_gridview_path.match(path):
172− if scan_for_flickable_imports(path, flickable_pats, quick_good_pat, components_import_pat):
173− found_bad_import = True
175+ if scan_for_flickable_imports(path, flickable_pats, quick_good_pat, components_import_pat):
176+ found_bad_import = True
174177
175178except OSError as e:
176179 error("cannot create file list for \"" + dir + "\": " + e.strerror)