From e59cd33555bf888ac2ea48a09c31f738a4cb0ee6 Mon Sep 17 00:00:00 2001 From: althafvly Date: Wed, 20 Nov 2024 12:40:13 +0530 Subject: [PATCH] camera: Add link check for translations --- .gitignore | 1 + .gitlab-ci.yml | 7 +++++++ check_lint.sh | 16 ++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100755 check_lint.sh diff --git a/.gitignore b/.gitignore index 775172ba3..32c05826d 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ testdata/ local.properties uninstall.bat +lint-results.txt diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8957a8239..56486fe59 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,7 @@ image: "registry.gitlab.e.foundation/e/os/docker-android-apps-cicd:latest" stages: - update-from-upstream + - lint - build before_script: @@ -9,6 +10,12 @@ before_script: - export GRADLE_USER_HOME=$(pwd)/.gradle - chmod +x ./gradlew +lint: + stage: lint + script: + - chmod +x check_lint.sh + - ./check_lint.sh + cache: key: ${CI_PROJECT_ID} paths: diff --git a/check_lint.sh b/check_lint.sh new file mode 100755 index 000000000..e2b3df971 --- /dev/null +++ b/check_lint.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +./gradlew lint > lint-results.txt + +# Check if "Multiple substitutions specified" or "StringFormatMatches" exist in the lint results +grep -qE "Multiple substitutions specified|StringFormatMatches" lint-results.txt + +GREP_STATUS=$? + +if [ $GREP_STATUS -eq 0 ]; then + echo "Test Failed: Lint issues found (Multiple substitutions or String format match)" + exit 1 +else + echo "Test Passed: No lint issues found" + exit 0 +fi -- GitLab