1# python3 2# Copyright (C) 2019 The Android Open Source Project 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15 16"""Warning patterns for build make tools.""" 17 18# pylint:disable=relative-beyond-top-level 19from .cpp_warn_patterns import compile_patterns 20from .severity import Severity 21 22warn_patterns = [ 23 # pylint does not recognize g-inconsistent-quotes 24 # pylint:disable=line-too-long,bad-option-value,g-inconsistent-quotes 25 {'category': 'make', 'severity': Severity.MEDIUM, 26 'description': 'make: overriding commands/ignoring old commands', 27 'patterns': [r".*: warning: overriding commands for target .+", 28 r".*: warning: ignoring old commands for target .+"]}, 29 {'category': 'make', 'severity': Severity.HIGH, 30 'description': 'make: LOCAL_CLANG is false', 31 'patterns': [r".*: warning: LOCAL_CLANG is set to false"]}, 32 {'category': 'make', 'severity': Severity.HIGH, 33 'description': 'SDK App using platform shared library', 34 'patterns': [r".*: warning: .+ \(.*app:sdk.*\) should not link to .+ \(native:platform\)"]}, 35 {'category': 'make', 'severity': Severity.HIGH, 36 'description': 'System module linking to a vendor module', 37 'patterns': [r".*: warning: .+ \(.+\) should not link to .+ \(partition:.+\)"]}, 38 {'category': 'make', 'severity': Severity.MEDIUM, 39 'description': 'Invalid SDK/NDK linking', 40 'patterns': [r".*: warning: .+ \(.+\) should not link to .+ \(.+\)"]}, 41 {'category': 'make', 'severity': Severity.MEDIUM, 42 'description': 'Duplicate header copy', 43 'patterns': [r".*: warning: Duplicate header copy: .+"]}, 44 {'category': 'FindEmulator', 'severity': Severity.HARMLESS, 45 'description': 'FindEmulator: No such file or directory', 46 'patterns': [r".*: warning: FindEmulator: .* No such file or directory"]}, 47 {'category': 'make', 'severity': Severity.HARMLESS, 48 'description': 'make: unknown installed file', 49 'patterns': [r".*: warning: .*_tests: Unknown installed file for module"]}, 50 {'category': 'make', 'severity': Severity.HARMLESS, 51 'description': 'unusual tags debug eng', 52 'patterns': [r".*: warning: .*: unusual tags debug eng"]}, 53 {'category': 'make', 'severity': Severity.MEDIUM, 54 'description': 'make: please convert to soong', 55 'patterns': [r".*: warning: .* has been deprecated. Please convert to Soong."]}, 56 {'category': 'make', 'severity': Severity.MEDIUM, 57 'description': 'make: deprecated macros', 58 'patterns': [r".*\.mk:.* warning:.* [A-Z_]+ (is|has been) deprecated."]}, 59] 60 61 62compile_patterns(warn_patterns) 63