Skip to content

Commit

Permalink
Merge branch 'master' into swift
Browse files Browse the repository at this point in the history
  • Loading branch information
LEOYoon-Tsaw committed Jun 29, 2024
2 parents bafeed5 + 08c410f commit d7eec12
Show file tree
Hide file tree
Showing 29 changed files with 1,222 additions and 757 deletions.
2 changes: 0 additions & 2 deletions .clang-format

This file was deleted.

2 changes: 0 additions & 2 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# apply clang format
ce94f9c4403b9c33d5e251fc7f1e15c44725d881

29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-報告.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Bug 報告
about: 我覺得這是個 Bug
title: "[Bug] 我其實沒有遇到Bug"
labels: ''
assignees: ''

---

**簡要描述 Bug:**
~~我其實沒有遇到Bug~~

**預期行爲:**

**實際行爲:**

**環境**
- 系統版本: (macOS 14.5)
- 鼠鬚管版本: (1.0.0)
- 方案: (如果你用的是自定義或第三方的方案,且該 Bug 可能與方案有關,請提供方案鏈接)
- [ ] 使用了 Lua: (用了甚麼 Lua 腳本?)
- [ ] 與其它 App 有關: (哪個 App?)

**我試過:**
- [ ] 我換了內置的方案(如`朙月拼音`)後問題仍存在
- [ ] 我找到了導致問題出現的具體設置: (何設置?)
- [ ] 這是個新 Bug,以前真的沒有
- [ ] 我對原因有一些猜想: (你的寳貴想法)
- [ ] 在 Issues(包括已關閉的 Issue) 中未找到相關的報告
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Bug report
about: Is this a bug?
title: "[Bug] What have I done?"
labels: ''
assignees: ''

---

**Describe the bug:**
~~Actually it's not a bug after all

**Expected behavior:**

**Actual behavior:**

**Environment**
- OS version: (macOS 14.5)
- Squirrel version: (1.0.0)
- Schema: (If you are using a custom schema, and think it might be related to the schema, please provide a link)
- [ ] Using Lua: (what Lua script do you use?)
- [ ] Related to other apps: (which app?)

**Things you've tried**
- [ ] I tried a built-in schema (like `luna pinyin`), but the bug persists
- [ ] I found the exact setting that produced this bug: (which one?)
- [ ] This bug is new in this version
- [ ] I think the cause might be: (your thoughts)
- [ ] I don't find a similar report in Issues (including closed Issues)
12 changes: 9 additions & 3 deletions .github/workflows/commit-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
with:
submodules: true

- name: Install clang-format
run: brew install clang-format
- name: Install SwiftLint
run: brew install swiftlint

- name: Lint
run: make clang-format-lint
run: swiftlint

- name: Configure build environment
run: |
Expand All @@ -25,6 +25,12 @@ jobs:
- name: Build Squirrel
run: ./action-build.sh package

- name: Install periphery
run: brew install peripheryapp/periphery/periphery

- name: Check Unused Code
run: periphery scan --relative-results --skip-build --index-store-path build/Index.noindex/DataStore

- name: Upload Squirrel artifact
uses: actions/upload-artifact@v4
with:
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/pull-request-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
with:
submodules: true

- name: Install clang-format
run: brew install clang-format
- name: Install SwiftLint
run: brew install swiftlint

- name: Lint
run: make clang-format-lint
run: swiftlint

- name: Configure build environment
run: |
Expand All @@ -22,6 +22,12 @@ jobs:
- name: Build Squirrel
run: ./action-build.sh package

- name: Install periphery
run: brew install peripheryapp/periphery/periphery

- name: Check Unused Code
run: periphery scan --relative-results --skip-build --index-store-path build/Index.noindex/DataStore

- name: Upload Squirrel artifact
uses: actions/upload-artifact@v4
with:
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/release-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
- '*'
branches:
- master
paths:
- 'sources/**'
workflow_dispatch:

jobs:
Expand All @@ -19,15 +21,21 @@ jobs:
fetch-depth: 0
submodules: true

- name: Install clang-format
run: brew install clang-format
- name: Install SwiftLint
run: brew install swiftlint

- name: Lint
run: make clang-format-lint
run: swiftlint

- name: Build Squirrel
run: ./action-build.sh archive

- name: Install periphery
run: brew install peripheryapp/periphery/periphery

- name: Check Unused Code
run: periphery scan --relative-results --skip-build --index-store-path build/Index.noindex/DataStore

- name: Build changelog
id: release_log
run: |
Expand Down
6 changes: 6 additions & 0 deletions .periphery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
project: Squirrel.xcodeproj
schemes:
- Squirrel
targets:
- Squirrel
format: github-actions
56 changes: 56 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# By default, SwiftLint uses a set of sensible default rules you can adjust:
disabled_rules: # rule identifiers turned on by default to exclude from running
- force_cast
- force_try
- todo
opt_in_rules: # some rules are turned off by default, so you need to opt-in

# Alternatively, specify all rules explicitly by uncommenting this option:
# only_rules: # delete `disabled_rules` & `opt_in_rules` if using this
# - empty_parameters
# - vertical_whitespace

analyzer_rules: # rules run by `swiftlint analyze`
- explicit_self

included: # case-sensitive paths to include during linting. `--path` is ignored if present
- sources
excluded: # case-sensitive paths to ignore during linting. Takes precedence over `included`

# If true, SwiftLint will not fail if no lintable files are found.
allow_zero_lintable_files: false

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

# rules that have both warning and error levels, can set just the warning level
# implicitly
line_length: 200
function_body_length: 200
# they can set both implicitly with an array
type_body_length:
- 300 # warning
- 400 # error
# or they can set both explicitly
file_length:
warning: 800
error: 1200
# naming rules can set warnings/errors for min_length and max_length
# additionally they can set excluded names
type_name:
min_length: 4 # only warning
max_length: # warning and error
warning: 40
error: 50
excluded: # excluded via string
allowed_symbols: ["_"] # these are allowed in type names
identifier_name:
min_length: # only min_length
warning: 3
error: 2
excluded: [i, URL, of, by] # excluded via string array
large_tuple:
warning: 3
error: 5
reporter: "github-actions-logging" # reporter type (xcode, json, csv, checkstyle, codeclimate, junit, html, emoji, sonarqube, markdown, github-actions-logging, summary)

85 changes: 85 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,88 @@
<a name="1.0.2"></a>
## 1.0.2 (2024-06-07)

#### 其它更新內容
* bug 修復
* 未設定暗色主題時,配色不生效
* 橫排時序號偏高
* 帶 Alt 的快捷鍵不生效
* App 特定設置 inline 不生效
* `good_old_caps_lock` 關閉,且 Caps Lock 啓用時,Shift 無法輸入大寫字母
* Edge 瀏覧器默認行內編輯 (修 #906)
* 日誌置於 $TMPDIR/rime.squirrel 內,以便查找

#### Other Updates
* Bug fixes:
* `color_scheme` doesn't apply in dark mode when `color_scheme_dark` is not set
* Label baseline too high in horizontal orientation
* Shortcut with Alt doesn't work
* inline option in app specific setting doesn't work
* when `good_old_caps_lock` turned to false, and Caps Lock is on, Shift cannot product upper case letter
* Edge defaults to inline mode (fix #906)
* Logs dir is now $TMPDIR/rime.squirrel for clarity

**Full Changelog**: https://github.com/rime/squirrel/compare/1.0.1...1.0.2

<a name="1.0.1"></a>
## 1.0.1 (2024-06-01)

#### 其它更新內容
* bug 修復
* 不再注冊爲拉丁輸入法,修復 Caps Lock 切換輸入法時不能切換至西文的問題
* 修復配色中的 candidate_list_layout, text_orientation 不生效問題
* 修復字體名無法解析時,字號不生效問題
* 不再支持 `style/horizontal``style/vertical`

#### Other Updates
* Bug fixes:
* Remove Latn repertoire so that switching IME by Caps Lock can toggle Squirrel and Latin input
* Fix: candidate_list_layout, text_orientation do not take effect when put in color scheme
* Fix: font point is ignored when font face is invalid
* Drop support for `style/horizontal` and `style/vertical`

**Full Changelog**: https://github.com/rime/squirrel/compare/1.0.0...1.0.1

<a name="1.0.0"></a>
## 1.0.0 (2024-05-30)

#### 主要功能更新
* 純 Swift 重寫,代碼更易維護,更易讀,貢獻代碼的門檻更低。今天就來看看源代碼,嘗試動手吧!

#### 其它更新內容
* UI 設置【**敬請留意**
* `style/candidate_format` 格式修改爲 `"[label]. [candidate] [comment]"`,原格式仍能使用,但建議遷移至更靈活、直觀的新格式
* `style/horizontal` 將徹底移除,雖然本版程序仍支持,但會被新控件的默認值覆蓋
請使用 `candidate_list_layout`: `stacked`/`linear``text_orientation`: `horizontal`/`vertical`
* `style/label_hilited_color` 已移除,請使用 `style/hilited_candidate_label_color`
* `native` 配色小幅修改,減小字號,更像原生輸入法
* UI
* 在菜單欄新增日志檔案夾,方便快速進入
* 序號居中顯示,更像原生輸入法
* 新增 `--help` 命令行命令,以便查詢支持的命令
* bug 修復
* 減少使用<kbd>⇧</kbd>輸入大寫時造成中英切換的可能性
* librime:使用 stdbool 後綴 API,以便與 Swift 更好橋接

#### Major Update
* Migrated code to pure Swift, which is easier to code, read and learn. Build your own Squirrel today!

#### Other Updates
* UI settings (**Breaking Changes**)
* `style/candidate_format` now updated to `"[index]. [candidate] [comment]"`, while the old format still works, please consider migrating to this more readable and flexible format at your convenience
* `style/horizontal` will be dropped, it's still supported but will be overwrite by the default values of new options.
Please adopt `candidate_list_layout`: `stacked`/`linear` and `text_orientation`: `horizontal`/`vertical`
* `style/label_hilited_color` is removed, please use `style/hilited_candidate_label_color` instead
* `native` color scheme is updated with smaller font size, to better match macOS builtin IME
* UI
* Added a menu item for logs folder with easy access
* labels will vertically center if label font is smaller than candidate font, to better match macOS builtin IME
* Added `--help` command line argument
* Bug fixes:
* Reduce the chance that ascii mode may unintentionally switch when pressing <kbd>⇧</kbd> to enter Cap case
* librime: Use stdbool flavored API, for better Swift interoperation

**Full Changelog**: https://github.com/rime/squirrel/compare/0.18...1.0.0

<a name="0.18"></a>
## 0.18 (2024-05-04)

Expand Down
8 changes: 7 additions & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ To clean up **dependencies**, including librime, librime plugins, plum and spark
make clean-deps
```
If you want to clean both, do both.
To clean up **packages**, run:
``` sh
make clean-package
```
If you want to clean all above, do all.
That's it, a verbal journal. Thanks for riming with Squirrel.
Loading

0 comments on commit d7eec12

Please sign in to comment.