2020-01-10 19:33:40 +01:00
|
|
|
# python3
|
2019-12-10 04:32:03 +01:00
|
|
|
# Copyright (C) 2019 The Android Open Source Project
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
"""Define a project list to sort warnings by project directory path."""
|
|
|
|
|
|
|
|
|
2020-01-10 19:33:40 +01:00
|
|
|
def create_pattern(name, pattern=None):
|
2021-04-28 23:49:32 +02:00
|
|
|
"""Return a tuple of name and warn patten."""
|
2020-01-10 19:33:40 +01:00
|
|
|
if pattern is not None:
|
|
|
|
return [name, '(^|.*/)' + pattern + '/.*: warning:']
|
|
|
|
return [name, '(^|.*/)' + name + '/.*: warning:']
|
2019-12-10 04:32:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
# A list of [project_name, file_path_pattern].
|
|
|
|
# project_name should not contain comma, to be used in CSV output.
|
|
|
|
project_list = [
|
2020-01-10 19:33:40 +01:00
|
|
|
create_pattern('art'),
|
|
|
|
create_pattern('bionic'),
|
|
|
|
create_pattern('bootable'),
|
|
|
|
create_pattern('build'),
|
|
|
|
create_pattern('cts'),
|
|
|
|
create_pattern('dalvik'),
|
|
|
|
create_pattern('developers'),
|
|
|
|
create_pattern('development'),
|
|
|
|
create_pattern('device'),
|
|
|
|
create_pattern('doc'),
|
2019-12-10 04:32:03 +01:00
|
|
|
# match external/google* before external/
|
2020-01-10 19:33:40 +01:00
|
|
|
create_pattern('external/google', 'external/google.*'),
|
|
|
|
create_pattern('external/non-google', 'external'),
|
|
|
|
create_pattern('frameworks/av/camera'),
|
|
|
|
create_pattern('frameworks/av/cmds'),
|
|
|
|
create_pattern('frameworks/av/drm'),
|
|
|
|
create_pattern('frameworks/av/include'),
|
|
|
|
create_pattern('frameworks/av/media/img_utils'),
|
|
|
|
create_pattern('frameworks/av/media/libcpustats'),
|
|
|
|
create_pattern('frameworks/av/media/libeffects'),
|
|
|
|
create_pattern('frameworks/av/media/libmediaplayerservice'),
|
|
|
|
create_pattern('frameworks/av/media/libmedia'),
|
|
|
|
create_pattern('frameworks/av/media/libstagefright'),
|
|
|
|
create_pattern('frameworks/av/media/mtp'),
|
|
|
|
create_pattern('frameworks/av/media/ndk'),
|
|
|
|
create_pattern('frameworks/av/media/utils'),
|
|
|
|
create_pattern('frameworks/av/media/Other', 'frameworks/av/media'),
|
|
|
|
create_pattern('frameworks/av/radio'),
|
|
|
|
create_pattern('frameworks/av/services'),
|
|
|
|
create_pattern('frameworks/av/soundtrigger'),
|
|
|
|
create_pattern('frameworks/av/Other', 'frameworks/av'),
|
|
|
|
create_pattern('frameworks/base/cmds'),
|
|
|
|
create_pattern('frameworks/base/core'),
|
|
|
|
create_pattern('frameworks/base/drm'),
|
|
|
|
create_pattern('frameworks/base/media'),
|
|
|
|
create_pattern('frameworks/base/libs'),
|
|
|
|
create_pattern('frameworks/base/native'),
|
|
|
|
create_pattern('frameworks/base/packages'),
|
|
|
|
create_pattern('frameworks/base/rs'),
|
|
|
|
create_pattern('frameworks/base/services'),
|
|
|
|
create_pattern('frameworks/base/tests'),
|
|
|
|
create_pattern('frameworks/base/tools'),
|
|
|
|
create_pattern('frameworks/base/Other', 'frameworks/base'),
|
|
|
|
create_pattern('frameworks/compile/libbcc'),
|
|
|
|
create_pattern('frameworks/compile/mclinker'),
|
|
|
|
create_pattern('frameworks/compile/slang'),
|
|
|
|
create_pattern('frameworks/compile/Other', 'frameworks/compile'),
|
|
|
|
create_pattern('frameworks/minikin'),
|
|
|
|
create_pattern('frameworks/ml'),
|
|
|
|
create_pattern('frameworks/native/cmds'),
|
|
|
|
create_pattern('frameworks/native/include'),
|
|
|
|
create_pattern('frameworks/native/libs'),
|
|
|
|
create_pattern('frameworks/native/opengl'),
|
|
|
|
create_pattern('frameworks/native/services'),
|
|
|
|
create_pattern('frameworks/native/vulkan'),
|
|
|
|
create_pattern('frameworks/native/Other', 'frameworks/native'),
|
|
|
|
create_pattern('frameworks/opt'),
|
|
|
|
create_pattern('frameworks/rs'),
|
|
|
|
create_pattern('frameworks/webview'),
|
|
|
|
create_pattern('frameworks/wilhelm'),
|
|
|
|
create_pattern('frameworks/Other', 'frameworks'),
|
|
|
|
create_pattern('hardware/akm'),
|
|
|
|
create_pattern('hardware/broadcom'),
|
|
|
|
create_pattern('hardware/google'),
|
|
|
|
create_pattern('hardware/intel'),
|
|
|
|
create_pattern('hardware/interfaces'),
|
|
|
|
create_pattern('hardware/libhardware'),
|
|
|
|
create_pattern('hardware/libhardware_legacy'),
|
|
|
|
create_pattern('hardware/qcom'),
|
|
|
|
create_pattern('hardware/ril'),
|
|
|
|
create_pattern('hardware/Other', 'hardware'),
|
|
|
|
create_pattern('kernel'),
|
|
|
|
create_pattern('libcore'),
|
|
|
|
create_pattern('libnativehelper'),
|
|
|
|
create_pattern('ndk'),
|
2019-12-10 04:32:03 +01:00
|
|
|
# match vendor/unbungled_google/packages before other packages
|
2020-01-10 19:33:40 +01:00
|
|
|
create_pattern('unbundled_google'),
|
2020-05-03 19:36:16 +02:00
|
|
|
create_pattern('packages/providers/MediaProvider'),
|
2020-01-10 19:33:40 +01:00
|
|
|
create_pattern('packages'),
|
|
|
|
create_pattern('pdk'),
|
|
|
|
create_pattern('prebuilts'),
|
|
|
|
create_pattern('system/bt'),
|
|
|
|
create_pattern('system/connectivity'),
|
|
|
|
create_pattern('system/core/adb'),
|
2020-10-23 16:15:26 +02:00
|
|
|
create_pattern('system/libbase'),
|
2020-01-10 19:33:40 +01:00
|
|
|
create_pattern('system/core/debuggerd'),
|
|
|
|
create_pattern('system/core/fastboot'),
|
|
|
|
create_pattern('system/core/fingerprintd'),
|
|
|
|
create_pattern('system/core/fs_mgr'),
|
|
|
|
create_pattern('system/core/gatekeeperd'),
|
|
|
|
create_pattern('system/core/healthd'),
|
|
|
|
create_pattern('system/core/include'),
|
|
|
|
create_pattern('system/core/init'),
|
2020-10-27 20:44:34 +01:00
|
|
|
create_pattern('system/unwinding/libbacktrace'),
|
2020-10-26 15:34:45 +01:00
|
|
|
create_pattern('system/logging/liblog'),
|
2020-01-10 19:33:40 +01:00
|
|
|
create_pattern('system/core/libpixelflinger'),
|
|
|
|
create_pattern('system/core/libprocessgroup'),
|
|
|
|
create_pattern('system/core/libsysutils'),
|
|
|
|
create_pattern('system/core/logcat'),
|
|
|
|
create_pattern('system/core/logd'),
|
|
|
|
create_pattern('system/core/run-as'),
|
|
|
|
create_pattern('system/core/sdcard'),
|
|
|
|
create_pattern('system/core/toolbox'),
|
|
|
|
create_pattern('system/core/Other', 'system/core'),
|
|
|
|
create_pattern('system/extras/ANRdaemon'),
|
|
|
|
create_pattern('system/extras/cpustats'),
|
|
|
|
create_pattern('system/extras/crypto-perf'),
|
|
|
|
create_pattern('system/extras/ext4_utils'),
|
|
|
|
create_pattern('system/extras/f2fs_utils'),
|
|
|
|
create_pattern('system/extras/iotop'),
|
|
|
|
create_pattern('system/extras/libfec'),
|
|
|
|
create_pattern('system/extras/memory_replay'),
|
|
|
|
create_pattern('system/extras/mmap-perf'),
|
|
|
|
create_pattern('system/extras/multinetwork'),
|
|
|
|
create_pattern('system/extras/perfprofd'),
|
|
|
|
create_pattern('system/extras/procrank'),
|
|
|
|
create_pattern('system/extras/runconuid'),
|
|
|
|
create_pattern('system/extras/showmap'),
|
|
|
|
create_pattern('system/extras/simpleperf'),
|
|
|
|
create_pattern('system/extras/su'),
|
|
|
|
create_pattern('system/extras/tests'),
|
|
|
|
create_pattern('system/extras/verity'),
|
|
|
|
create_pattern('system/extras/Other', 'system/extras'),
|
|
|
|
create_pattern('system/gatekeeper'),
|
|
|
|
create_pattern('system/keymaster'),
|
|
|
|
create_pattern('system/libhidl'),
|
|
|
|
create_pattern('system/libhwbinder'),
|
|
|
|
create_pattern('system/media'),
|
|
|
|
create_pattern('system/netd'),
|
|
|
|
create_pattern('system/nvram'),
|
|
|
|
create_pattern('system/security'),
|
|
|
|
create_pattern('system/sepolicy'),
|
|
|
|
create_pattern('system/tools'),
|
|
|
|
create_pattern('system/update_engine'),
|
|
|
|
create_pattern('system/vold'),
|
|
|
|
create_pattern('system/Other', 'system'),
|
|
|
|
create_pattern('toolchain'),
|
|
|
|
create_pattern('test'),
|
|
|
|
create_pattern('tools'),
|
2019-12-10 04:32:03 +01:00
|
|
|
# match vendor/google* before vendor/
|
2020-01-10 19:33:40 +01:00
|
|
|
create_pattern('vendor/google', 'vendor/google.*'),
|
|
|
|
create_pattern('vendor/non-google', 'vendor'),
|
2019-12-10 04:32:03 +01:00
|
|
|
# keep out/obj and other patterns at the end.
|
2020-01-10 19:33:40 +01:00
|
|
|
[
|
|
|
|
'out/obj', '.*/(gen|obj[^/]*)/(include|EXECUTABLES|SHARED_LIBRARIES|'
|
|
|
|
'STATIC_LIBRARIES|NATIVE_TESTS)/.*: warning:'
|
|
|
|
],
|
2019-12-10 04:32:03 +01:00
|
|
|
['other', '.*'] # all other unrecognized patterns
|
|
|
|
]
|