diff --git a/tools/check/check_code_quality.sh b/tools/check/check_code_quality.sh index af09dce9d4..e40d3635e8 100755 --- a/tools/check/check_code_quality.sh +++ b/tools/check/check_code_quality.sh @@ -84,6 +84,18 @@ ${searchForbiddenStringsScript} ./tools/check/forbidden_strings_in_code_sdk.txt resultForbiddenStringInCodeSdk=$? +echo +echo "Search for forbidden patterns specific for App code..." + +${searchForbiddenStringsScript} ./tools/check/forbidden_strings_in_code_app.txt \ + ./vector/src/main/java \ + ./vector/src/debug/java \ + ./vector/src/release/java \ + ./vector/src/fdroid/java \ + ./vector/src/gplay/java + +resultForbiddenStringInCodeApp=$? + echo echo "Search for forbidden patterns in resources..." @@ -167,6 +179,7 @@ echo if [[ ${resultNbOfDrawable} -eq 0 ]] \ && [[ ${resultForbiddenStringInCode} -eq 0 ]] \ && [[ ${resultForbiddenStringInCodeSdk} -eq 0 ]] \ + && [[ ${resultForbiddenStringInCodeApp} -eq 0 ]] \ && [[ ${resultForbiddenStringInResource} -eq 0 ]] \ && [[ ${resultForbiddenStringInLayout} -eq 0 ]] \ && [[ ${resultLongFiles} -eq 0 ]] \ diff --git a/tools/check/forbidden_strings_in_code_app.txt b/tools/check/forbidden_strings_in_code_app.txt new file mode 100644 index 0000000000..2a74d321af --- /dev/null +++ b/tools/check/forbidden_strings_in_code_app.txt @@ -0,0 +1,18 @@ +# +# Copyright 2022 New Vector Ltd +# +# 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. +# + +### You should not use code from internal SDK package. Either move them to the API package, or add a proper API to access this code, and add internal keyword SDK side. +import org.matrix.android.sdk.internal