Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge release 3.2.0-rc1 to trunk #638

Merged
merged 20 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
66f67e6
Add SwiftLint configuration
andrewdmontgomery Jan 14, 2025
82072b6
Fix swiftlint.yml file
andrewdmontgomery Jan 14, 2025
23c280c
Use SwiftLint docker image for linting with SwiftLint in Makefile
andrewdmontgomery Jan 14, 2025
f45dfc3
Convert SwiftFormat to use Docker in Makefile
andrewdmontgomery Jan 14, 2025
1d4e5b6
Update linting in CI to use docker
andrewdmontgomery Jan 14, 2025
2c02b35
Remove volumes declarations
andrewdmontgomery Jan 14, 2025
1bd4097
Use the `linter` agent for SwiftLint instead of docker build
andrewdmontgomery Jan 14, 2025
fc17917
Disable SwiftFormat linting temporarily
andrewdmontgomery Jan 14, 2025
d24beaf
Revert "Disable SwiftFormat linting temporarily"
andrewdmontgomery Jan 14, 2025
5957f13
Group Linters
andrewdmontgomery Jan 14, 2025
ac184f9
Add notify to SwiftFormat Linting
andrewdmontgomery Jan 14, 2025
2c87eea
Bump up version to 3.2.0-rc.1
pinarol Jan 15, 2025
b85f036
Update localizations
pinarol Jan 15, 2025
47a4421
Increase the delay a bit
pinarol Jan 15, 2025
aae7bc5
Move the SwiftLint version source of truth into the `.swiftlint.yml` …
andrewdmontgomery Jan 15, 2025
e07aaa5
Use SwiftLint 0.57.1
andrewdmontgomery Jan 15, 2025
dca68a5
Remove SwiftFormat as a package dependency
andrewdmontgomery Jan 15, 2025
31463c0
Make the .swiftformat file the source of truth for version info
andrewdmontgomery Jan 15, 2025
79191b3
Release 3.2.0-rc.1 (#635)
pinarol Jan 16, 2025
fefeffe
Moving SwiftLint and SwiftFormat to Docker (#634)
andrewdmontgomery Jan 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 35 additions & 14 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,47 @@ agents:
queue: "mac"
env:
IMAGE_ID: $IMAGE_ID
SWIFTFORMAT_VERSION: $SWIFTFORMAT_VERSION

steps:
#################
# Lint Source files
#################
- label: "🕵️ Lint"
key: "lint"
command: |
echo "--- 🛠 Linting"
make lint
- group: "Linters"
steps:
- label: ":swift: SwiftLint"
command: swiftlint
notify:
- github_commit_status:
context: "SwiftLint"
agents:
queue: "linter"

- label: ☢️ Danger - PR Check
command: danger
key: danger
if: build.pull_request.id != null
retry:
manual:
permit_on_passed: true
agents:
queue: linter
- label: ":swift: SwiftFormat Linting"
plugins:
- docker#v5.12.0:
image: "ghcr.io/nicklockwood/swiftformat:$SWIFTFORMAT_VERSION"
command: ["--lint", "Sources"]
workdir: "${BUILDKITE_BUILD_CHECKOUT_PATH}"
- docker#v5.12.0:
image: "ghcr.io/nicklockwood/swiftformat:$SWIFTFORMAT_VERSION"
command: ["--lint", "Tests"]
workdir: "${BUILDKITE_BUILD_CHECKOUT_PATH}"
notify:
- github_commit_status:
context: "SwiftFormat Linting"
agents:
queue: "default"

- label: ☢️ Danger - PR Check
command: danger
key: danger
if: build.pull_request.id != null
retry:
manual:
permit_on_passed: true
agents:
queue: linter

#################
# Build and Test
Expand Down
2 changes: 2 additions & 0 deletions .buildkite/shared-pipeline-vars
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
export IMAGE_ID="xcode-16.2-macos-14.7.1-v1"

export CI_TOOLKIT="automattic/a8c-ci-toolkit#3.2.2"

export SWIFTFORMAT_VERSION=$( awk '/^--minversion/ { print $2 }' .swiftformat )
3 changes: 3 additions & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## SwiftFormat version
--minversion 0.54.5

## Swift version

# Some rules are applicable only to newer versions of Swift.
Expand Down
21 changes: 21 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
swiftlint_version: 0.57.1
only_rules: # Rules to run
- custom_rules

# If true, SwiftLint will treat all warnings as errors.
strict: true

included:
- Sources
- Tests

custom_rules:
no_ns_localized_string:
included:
- "Sources/.*\\.swift"
name: "No NSLocalizedString"
regex: "NSLocalizedString\\("
match_kinds:
- identifier
message: "Use `SDKLocalizedString()` instead of `NSLocalizedString()`."
severity: error
47 changes: 34 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
.PHONY: all clean run
.PHONY: all clean run swiftlint

# To see how to drive this makefile use:
#
# % make help

# Cache
# No spaces allowed
SWIFTFORMAT_CACHE = ~/Library/Caches/com.charcoaldesign.swiftformat
# SwiftLint
SWIFTLINT_VERSION := $(shell awk -F': ' '/^swiftlint_version: / {print $$2}' .swiftlint.yml)
SWIFTLINT_DOCKER_BUILDER_NAME = swiftlint_builder

# SwiftFormat
SWIFTFORMAT_VERSION := $(shell awk '/^--minversion/ { print $$2 }' .swiftformat)

# The following values can be changed here, or passed on the command line.
OPENAPI_GENERATOR_DOCKER_IMAGE ?= openapitools/openapi-generator-cli
Expand Down Expand Up @@ -66,17 +69,35 @@ setup-secrets: bundle-install
bundle exec fastlane run configure_apply

swiftformat: # Automatically find and fixes lint issues
swift package plugin \
--allow-writing-to-package-directory \
--allow-writing-to-directory $(SWIFTFORMAT_CACHE) \
swiftformat
@docker run --rm -v $(shell pwd):$(shell pwd) -w $(shell pwd) ghcr.io/nicklockwood/swiftformat:$(SWIFTFORMAT_VERSION) Sources
@docker run --rm -v $(shell pwd):$(shell pwd) -w $(shell pwd) ghcr.io/nicklockwood/swiftformat:$(SWIFTFORMAT_VERSION) Tests

swiftformat-lint:
@docker run --rm -v $(shell pwd):$(shell pwd) -w $(shell pwd) ghcr.io/nicklockwood/swiftformat:$(SWIFTFORMAT_VERSION) --lint Sources
@docker run --rm -v $(shell pwd):$(shell pwd) -w $(shell pwd) ghcr.io/nicklockwood/swiftformat:$(SWIFTFORMAT_VERSION) --lint Tests

swiftlint: docker-swiftlint-builder swiftlint-run # Sets up the buildx builder and runs the swiftlint command

docker-swiftlint-builder: # Create and use the Buildx builder because the SwiftLint docker image doesn't support Apple Silicon
@if ! docker buildx inspect $(SWIFTLINT_DOCKER_BUILDER_NAME) >/dev/null 2>&1; then \
docker buildx create --use --name $(SWIFTLINT_DOCKER_BUILDER_NAME); \
else \
docker buildx use $(SWIFTLINT_DOCKER_BUILDER_NAME); \
fi

swiftlint-run: # Docker command to run swiftlint
docker run --platform linux/amd64 -v $(shell pwd):$(shell pwd) -w $(shell pwd) ghcr.io/realm/swiftlint:$(SWIFTLINT_VERSION)

swiftlint-version:
@if [ -z "$(SWIFTLINT_VERSION)" ]; then \
echo "SwiftLint version not found in .swiftlint.yml"; \
else \
echo "SwiftLint version: $(SWIFTLINT_VERSION)"; \
fi

lint: # Use swiftformat to warn about format issues
swift package plugin \
--allow-writing-to-package-directory \
--allow-writing-to-directory $(SWIFTFORMAT_CACHE) \
swiftformat \
--lint
@make swiftlint
@make swiftformat-lint

validate-pod: bundle-install
# For some reason this fixes a failure in `lib lint`
Expand Down
11 changes: 1 addition & 10 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"originHash" : "dddfee60d726ac68a5cd796dea6619c69dcce5cc55b1b6d7d75bb308b96243a1",
"originHash" : "ef380bfd827500bb40ef65e62058cb22bbebbf217402a19c327d4201d142ba21",
"pins" : [
{
"identity" : "swift-snapshot-testing",
Expand All @@ -18,15 +18,6 @@
"revision" : "303e5c5c36d6a558407d364878df131c3546fad8",
"version" : "510.0.2"
}
},
{
"identity" : "swiftformat",
"kind" : "remoteSourceControl",
"location" : "https://github.com/nicklockwood/SwiftFormat",
"state" : {
"revision" : "ab6844edb79a7b88dc6320e6cee0a0db7674dac3",
"version" : "0.54.5"
}
}
],
"version" : 3
Expand Down
1 change: 0 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ let package = Package(
),
],
dependencies: [
.package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.54.5"),
.package(url: "https://github.com/pointfreeco/swift-snapshot-testing", from: "1.17.6"),
],
targets: [
Expand Down
2 changes: 1 addition & 1 deletion Sources/Gravatar/Resources/SDKInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<plist version="1.0">
<dict>
<key>CFBundleShortVersionString</key>
<string>3.1.1</string>
<string>3.2.0-rc.1</string>
</dict>
</plist>
72 changes: 63 additions & 9 deletions Sources/GravatarUI/Resources/ar.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,16 +1,52 @@
/* Translation-Revision-Date: 2024-12-16 11:34:52+0000 */
/* Translation-Revision-Date: 2025-01-14 13:54:02+0000 */
/* Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5; */
/* Generator: GlotPress/2.4.0-alpha */
/* Language: ar */

/* Title for Cancel button. */
"AltText.Editor.cancelButtonTitle" = "إلغاء";

/* Placeholder text for Alt Text editor text field. */
"AltText.Editor.placeholder" = "كتابة النص البديل...";

/* Title for Save button. */
"AltText.Editor.saveButtonTitle" = "حفظ";

/* The title of Alt Text editor screen. */
"AltText.Editor.title" = "النص البديل";

/* Rating that indicates that the avatar is suitable for everyone */
"Avatar.Rating.G.subtitle" = "عام";

/* Rating that indicates that the avatar may not be suitable for children */
"Avatar.Rating.PG.subtitle" = "توجيه أبوي";

/* Rating that indicates that the avatar may not be suitable for children */
"Avatar.Rating.R.subtitle" = "مقيد";

/* Rating that indicates that the avatar is obviously and extremely unsuitable for children */
"Avatar.Rating.X.subtitle" = "حد أقصى";

/* An option in the avatar menu that edits the avatar's Alt Text. */
"AvatarPicker.AvatarAction.altText" = "النص البديل";

/* An option in the avatar menu that deletes the avatar */
"AvatarPicker.AvatarAction.delete" = "حذف";

/* An option in the avatar menu that shows the current rating, and allows the user to change that rating. The rating is used to indicate the appropriateness of an avatar for different audiences, and follows the US system of Motion Picture ratings: G, PG, R, and X. */
"AvatarPicker.AvatarAction.rate" = "التقييم: %@";

/* An option in the avatar menu that shares the avatar */
"AvatarPicker.AvatarAction.share" = "مشاركة...";

/* Title of a message advising the user that something went wrong while trying to log in. */
"AvatarPicker.ContentLoading.Failure.LogInError.title" = "يلزم تسجيل الدخول";
/* Headline of an intro screen for editing a user's profile. */
"AvatarPicker.ContentLoading.Failure.MissingToken.headline" = "تحرير ملفك الشخصي";

/* Subheadline of an intro screen for editing a user's profile. %@ is the name of a mobile app that uses Gravatar services. */
"AvatarPicker.ContentLoading.Failure.MissingToken.subheadline" = "حسِّن ملفك الشخصي على %@ باستخدام جرافتار.";

/* A message that informs the user about Gravatar. */
"AvatarPicker.ContentLoading.Failure.MissingToken.subtext" = "أدر ملفك الشخصي للويب في مكان واحد.";

/* Title of a button that allows the user to try loading their avatars again */
"AvatarPicker.ContentLoading.Failure.Retry.ctaButtonTitle" = "المحاولة مجددًا";
Expand All @@ -33,12 +69,6 @@
/* A message describing the error and advising the user to login again to resolve the issue */
"AvatarPicker.ContentLoading.Failure.SessionExpired.LogIn.subtext" = "انتهت صلاحية الجلسة لأسباب تتعلق بالأمان. يرجى تسجيل الدخول لتحديث صورتك الرمزية.";

/* Title of a button that will begin the process of authenticating the user, appearing beneath a message stating that a previous log in attept has failed. */
"AvatarPicker.ContentLoading.Failure.SessionExpired.LogInError.buttonTitle" = "تسجيل الدخول";

/* A message describing the error and advising the user to login again to resolve the issue */
"AvatarPicker.ContentLoading.Failure.SessionExpired.LogInError.subtext" = "لتعديل ملفك الشخصي على جرافتار، يجب عليك تسجيل الدخول أولاً.";

/* Title of a message advising the user that their login session has expired. */
"AvatarPicker.ContentLoading.Failure.SessionExpired.title" = "انتهت صلاحية الجلسة";

Expand All @@ -54,6 +84,9 @@
/* Title of a message advising the user to setup their avatar */
"AvatarPicker.ContentLoading.success.title" = "لنقم بإعداد الأفاتار الخاص بك";

/* Title of a button that will proceed with the action. */
"AvatarPicker.Continue.title" = "متابعة";

/* The title button which confirms the avatar deletion. */
"AvatarPicker.Deletion.Confirmation.ctaButtonTitle" = "حذف";

Expand All @@ -69,6 +102,9 @@
/* Title appearing in the header of a view that allows users to manage their avatars */
"AvatarPicker.Header.title" = "الصور الرمزية";

/* Message displayed when no image is selected */
"AvatarPicker.NoImageSelected.message" = "لم يتم تحديد صورة. يرجى تحديد صورة أو سيتم استخدام الصورة الافتراضية.";

/* Error message to show when the upload fails because the image is too big. */
"AvatarPicker.Upload.Error.ImageTooBig.Error" = "تتجاوز الصورة المتوفرة الحد الأقصى للحجم: 10 ميجابايت";

Expand All @@ -84,9 +120,27 @@
/* Title of a button that will take you to your Gravatar profile, with an arrow indicating that this action will cause you to leave this view */
"AvatarPickerProfile.Button.ViewProfile.title" = "عرض الملف الشخصي ←";

/* Placeholder text for the name field */
"AvatarPickerProfile.Name.placeholder" = "اسمك";

/* Placeholder text for some profile fields. */
"AvatarPickerProfile.ProfileFields.placeholder" = "الوظيفة، والموقع، والضمائر، وما إلى ذلك";

/* This error message shows when the user attempts to change the alt text of an avatar and fails. */
"AvatarPickerViewModel.AltText.Error" = "عذرًا، ثمَّة شيء لم يعمل بشكل طبيعي في أثناء محاولة تحديث النص البديل.";

/* This confirmation message shows when the user has updated the alt text. */
"AvatarPickerViewModel.AltText.Success" = "تم تغيير النص البديل للصورة بنجاح.";

/* This error message shows when the user attempts to delete an avatar and fails. */
"AvatarPickerViewModel.Delete.Error" = "عذرًا، كان هناك خطأ في أثناء حذف الصورة.";

/* This error message shows when the user attempts to change the rating of an avatar and fails. */
"AvatarPickerViewModel.Rating.Error" = "عذرًا، ثمَّة شيء لم يعمل بشكل طبيعي في أثناء محاولة تقييم صورتك الرمزية.";

/* This confirmation message shows when the user picks a different avatar rating and the change was applied successfully. */
"AvatarPickerViewModel.RatingUpdate.Success" = "تم تغيير تقييم الصورة الافتراضية بنجاح.";

/* This error message shows when the user attempts to share an avatar and fails. */
"AvatarPickerViewModel.Share.Fail" = "عذرًا، حدث خطأ ما في أثناء محاولة مشاركة صورتك الرمزية.";

Expand Down
Loading