π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Run Apple lint locally and in CI
Manav Rathi46c32fedd013
diff --git a/.github/scripts/ci/paths.json b/.github/scripts/ci/paths.jsonindex 533dfda147..f64b64ed08 100644--- a/.github/scripts/ci/paths.json+++ b/.github/scripts/ci/paths.json@@ -1,4 +1,5 @@{+ "apple-lint": [".github/workflows/apple-lint.yml", "apple/**"],"dependency-review": ["**/Cargo.lock","**/Cargo.toml",diff --git a/.github/workflows/apple-lint.yml b/.github/workflows/apple-lint.ymlnew file mode 100644index 0000000000..1361c9ca0e--- /dev/null+++ b/.github/workflows/apple-lint.yml@@ -0,0 +1,16 @@+name: "Lint (Apple)"++on:+ workflow_call:++permissions:+ contents: read++jobs:+ lint:+ runs-on: macos-latest+ steps:+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0+ with:+ persist-credentials: false+ - run: apple/scripts/lint.shdiff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex ab809d8cb3..b744fc9f93 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -24,6 +24,11 @@ jobs:- id: selectrun: node .github/scripts/ci/check.mjs select HEAD^1 HEAD+ apple-lint:+ needs: select+ if: ${{ contains(fromJSON(needs.select.outputs.jobs), 'apple-lint') }}+ uses: ./.github/workflows/apple-lint.yml+dependency-review:needs: selectif: ${{ contains(fromJSON(needs.select.outputs.jobs), 'dependency-review') }}@@ -99,6 +104,7 @@ jobs:if: ${{ always() }}needs:- select+ - apple-lint- dependency-review- desktop-lint- docs-verify-builddiff --git a/apple/.swiftlint.yml b/apple/.swiftlint.ymlindex 30c85abcbd..b814018b52 100644--- a/apple/.swiftlint.yml+++ b/apple/.swiftlint.yml@@ -8,11 +8,14 @@ only_rules:- identical_operands- duplicate_conditions- unused_setter_value+ - empty_count- blanket_disable_command- superfluous_disable_command+empty_count:+ only_after_dot: true+excluded:+ - apps/ensu # TODO: Include Ensu.- apps/cast/Cast/Generated/cast.swift--allow_zero_lintable_files: false-strict: true+ - .builddiff --git a/apple/scripts/Package.resolved b/apple/Package.resolvedsimilarity index 100%rename from apple/scripts/Package.resolvedrename to apple/Package.resolveddiff --git a/apple/scripts/Package.swift b/apple/Package.swiftsimilarity index 100%rename from apple/scripts/Package.swiftrename to apple/Package.swiftdiff --git a/apple/packages/EnteOnnxRuntime/Package.swift b/apple/packages/EnteOnnxRuntime/Package.swiftindex eb43259178..e2f11f63d4 100644--- a/apple/packages/EnteOnnxRuntime/Package.swift+++ b/apple/packages/EnteOnnxRuntime/Package.swift@@ -18,7 +18,8 @@ let package = Package(targets: [.binaryTarget(name: "onnxruntime",- url: "https://github.com/ente/ort-packaging/releases/download/ort-1.28.1-r1/onnxruntime-coreml-ios-1.28.1-r1.zip",+ url:+ "https://github.com/ente/ort-packaging/releases/download/ort-1.28.1-r1/onnxruntime-coreml-ios-1.28.1-r1.zip",checksum: "774b986bdd8a9f729a3e80ce7f7e7e695f0387be6f66633feaa9835c05e8557e")]diff --git a/apple/scripts/lint.sh b/apple/scripts/lint.shnew file mode 100755index 0000000000..82316a7bef--- /dev/null+++ b/apple/scripts/lint.sh@@ -0,0 +1,9 @@+#!/bin/bash+set -eo pipefail++cd "$(dirname "$0")/.."++# TODO: Include Ensu.+git ls-files -z --cached --others --exclude-standard -- '*.swift' ':!:apps/ensu/**' |+ xargs -0 swift format lint --strict+swift package plugin --allow-writing-to-package-directory swiftlint lint --strict