diff --git a/.buildkite/commands/lint.sh b/.buildkite/commands/lint.sh index 6a836fdbb25d..f504ec47463c 100755 --- a/.buildkite/commands/lint.sh +++ b/.buildkite/commands/lint.sh @@ -6,26 +6,20 @@ fi "$(dirname "${BASH_SOURCE[0]}")/restore-cache.sh" -echo "--- :rubygems: Setting up Gems" -install_gems - -echo "--- :globe_with_meridians: Check Locales Declaration Consistency" -bundle exec fastlane check_declared_locales_consistency app:"$1" - echo "--- :microscope: Linting" if [ "$1" = "wordpress" ]; then - ./gradlew lintWordpressVanillaRelease + ./gradlew lintWordpressVanillaDebug exit 0 fi if [ "$1" = "jetpack" ]; then set +e - ./gradlew lintJetpackVanillaRelease + ./gradlew lintJetpackVanillaDebug lint_exit_code=$? set -e - upload_sarif_to_github "WordPress/build/reports/lint-results-jetpackVanillaRelease.sarif" + upload_sarif_to_github "WordPress/build/reports/lint-results-jetpackVanillaDebug.sarif" exit $lint_exit_code fi diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 25b2f2aa7d4f..47423e9583ec 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -59,6 +59,17 @@ steps: artifact_paths: - "**/build/reports/detekt/detekt.html" + - label: "🌐 Locale Consistency" + command: | + if .buildkite/commands/should-skip-job.sh --job-type validation; then + exit 0 + fi + + install_gems + bundle exec fastlane check_declared_locales_consistency app:wordpress + bundle exec fastlane check_declared_locales_consistency app:jetpack + plugins: [$CI_TOOLKIT] + - label: "🕵️ Lint WordPress" command: ".buildkite/commands/lint.sh wordpress" plugins: [$CI_TOOLKIT] @@ -71,6 +82,36 @@ steps: artifact_paths: - "**/build/reports/lint-results*.*" + - label: "🕵️ Lint libs:editor" + command: | + if .buildkite/commands/should-skip-job.sh --job-type lint; then + exit 0 + fi + + .buildkite/commands/restore-cache.sh + ./gradlew :libs:editor:lint + plugins: [$CI_TOOLKIT] + + - label: "🕵️ Lint libs:login" + command: | + if .buildkite/commands/should-skip-job.sh --job-type lint; then + exit 0 + fi + + .buildkite/commands/restore-cache.sh + ./gradlew :libs:login:lint + plugins: [$CI_TOOLKIT] + + - label: "🕵️ Lint libs:image-editor" + command: | + if .buildkite/commands/should-skip-job.sh --job-type lint; then + exit 0 + fi + + .buildkite/commands/restore-cache.sh + ./gradlew :libs:image-editor:lint + plugins: [$CI_TOOLKIT] + ################# # Diff Reports ################# diff --git a/build.gradle b/build.gradle index 9595b7570c65..1aaaad09154c 100644 --- a/build.gradle +++ b/build.gradle @@ -100,7 +100,7 @@ subprojects { android { lintOptions { warningsAsErrors = true - checkDependencies true + checkDependencies false checkGeneratedSources = true lintConfig file("${project.rootDir}/config/lint/lint.xml") baseline file("${project.rootDir}/config/lint/baseline.xml") diff --git a/config/lint/lint.xml b/config/lint/lint.xml index 17d667000d83..019d8b4cebd3 100644 --- a/config/lint/lint.xml +++ b/config/lint/lint.xml @@ -55,6 +55,14 @@ + + + + + + + + diff --git a/fastlane/lanes/localization.rb b/fastlane/lanes/localization.rb index bc20c923a5c4..40e4a06d8dc8 100644 --- a/fastlane/lanes/localization.rb +++ b/fastlane/lanes/localization.rb @@ -278,11 +278,9 @@ JETPACK_MAIN_STRINGS_PATH = File.join(PROJECT_ROOT_FOLDER, 'WordPress', 'src', 'jetpack', 'res', 'values', 'strings.xml').freeze JETPACK_FROZEN_STRINGS_DIR_PATH = File.join(FASTLANE_FOLDER, 'jetpack_resources', 'values').freeze LOCAL_LIBRARIES_STRINGS_PATHS = [ - # NOTE: for those we don't set `add_ignore_attr` to true because we currently use `checkDependencies true` in `WordPress/build.gradle` - # Which will correctly detect strings from the app's `strings.xml` being used by one of the module. - { library: 'Image Editor', strings_path: './libs/image-editor/src/main/res/values/strings.xml', source_id: 'module:image-editor' }, - { library: 'Editor', strings_path: './libs/editor/src/main/res/values/strings.xml', source_id: 'module:editor' }, - { library: 'Login Library', strings_path: './libs/login/src/main/res/values/strings.xml', source_id: 'module:login' } + { library: 'Image Editor', strings_path: './libs/image-editor/src/main/res/values/strings.xml', source_id: 'module:image-editor', add_ignore_attr: true }, + { library: 'Editor', strings_path: './libs/editor/src/main/res/values/strings.xml', source_id: 'module:editor', add_ignore_attr: true }, + { library: 'Login Library', strings_path: './libs/login/src/main/res/values/strings.xml', source_id: 'module:login', add_ignore_attr: true } ].freeze REMOTE_LIBRARIES_STRINGS_PATHS = [ {