From 2a6814b07af04a1a2b97b37dff2a99030491c8c7 Mon Sep 17 00:00:00 2001 From: Jerry <89069957+Jerry23011@users.noreply.github.com> Date: Tue, 26 Sep 2023 10:55:30 -0700 Subject: [PATCH] Update README_CN (#5239) --- README_CN.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/README_CN.md b/README_CN.md index 5d8eccdb7c..aa47add4b6 100644 --- a/README_CN.md +++ b/README_CN.md @@ -45,7 +45,8 @@ $ mint install realm/SwiftLint ### 编译源代码: -你也可以通过 Clone SwiftLint 的 Git 仓库到本地然后执行 `make install` (Xcode 12.5+) 编译源代码的方式来安装。 +你也可以通过 clone SwiftLint 的 Git 仓库到本地然后执行 +`make install` (Xcode 15.0+) 以从源代码构建及安装。 ### 使用 Bazel @@ -66,8 +67,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "build_bazel_rules_apple", - sha256 = "f94e6dddf74739ef5cb30f000e13a2a613f6ebfa5e63588305a71fce8a8a9911", - url = "https://github.com/bazelbuild/rules_apple/releases/download/1.1.3/rules_apple.1.1.3.tar.gz", + sha256 = "390841dd5f8a85fc25776684f4793d56e21b098dfd7243cd145b9831e6ef8be6", + url = "https://github.com/bazelbuild/rules_apple/releases/download/2.4.1/rules_apple.2.4.1.tar.gz", ) load( @@ -93,8 +94,8 @@ swift_rules_extra_dependencies() http_archive( name = "SwiftLint", - sha256 = "7c454ff4abeeecdd9513f6293238a6d9f803b587eb93de147f9aa1be0d8337c4", - url = "https://github.com/realm/SwiftLint/releases/download/0.49.1/bazel.tar.gz", + sha256 = "c6ea58b9c72082cdc1ada4a2d48273ecc355896ed72204cedcc586b6ccb8aca6", + url = "https://github.com/realm/SwiftLint/releases/download/0.52.4/bazel.tar.gz", ) load("@SwiftLint//bazel:repos.bzl", "swiftlint_repos") @@ -129,6 +130,11 @@ bazel run -c opt @SwiftLint//:swiftlint ![](https://raw.githubusercontent.com/realm/SwiftLint/main/assets/runscript.png) +Xcode 15 对 Build Settings 进行了重大更改,它将 `ENABLE_USER_SCRIPT_SANDBOXING` 的默认值从 `NO` 更改为 `YES`。 +因此,SwiftLint 会遇到与缺少文件权限相关的错误,通常报错信息为:`error: Sandbox: swiftlint(19427) deny(1) file-read-data.` + +要解决此问题,需要手动将 `ENABLE_USER_SCRIPT_SANDBOXING` 设置为 `NO`,以针对 SwiftLint 配置的特定目标。 + 如果你是在搭载 Apple 芯片的 Mac 上通过 Homebrew 安装的 SwiftLint,你可能会遇到这个警告: > warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint @@ -438,6 +444,9 @@ excluded: # 执行 linting 时忽略的路径。 优先级比 `included` 更高 - Sources/ExcludedFolder - Sources/ExcludedFile.swift +# 如果值为 true,SwiftLint 将把所有警告都视为错误 +strict: false + # 可配置的规则可以通过这个配置文件来自定义 # 二进制规则可以设置他们的严格程度 force_cast: warning # 隐式