From 162c10c249c22305d700bbdba6958765d71ee476 Mon Sep 17 00:00:00 2001 From: Equim Date: Fri, 2 Feb 2024 21:15:21 +0800 Subject: [PATCH] ci: add typos --- .github/workflows/libriichi.yml | 3 +++ docs/src/user/build.md | 4 ++-- docs/src/user/docker.md | 4 ++-- libriichi/src/state/action.rs | 2 +- mortal/server.py | 2 +- typos.toml | 2 ++ 6 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 typos.toml diff --git a/.github/workflows/libriichi.yml b/.github/workflows/libriichi.yml index 5b8cb69..238a4d6 100644 --- a/.github/workflows/libriichi.yml +++ b/.github/workflows/libriichi.yml @@ -29,6 +29,9 @@ jobs: with: python-version: '3.11' + - name: Run typos + uses: crate-ci/typos@v1.18.0 + - name: Environment preparation id: prep run: | diff --git a/docs/src/user/build.md b/docs/src/user/build.md index 451ee95..de2e1ba 100644 --- a/docs/src/user/build.md +++ b/docs/src/user/build.md @@ -13,7 +13,7 @@ $ git clone https://github.com/Equim-chan/Mortal.git $ cd Mortal ``` -From now on, the root directory of Mortal will be demostrated as `$MORTAL_ROOT`. +From now on, the root directory of Mortal will be demonstrated as `$MORTAL_ROOT`. ### Create and activate a conda env > Working directory: `$MORTAL_ROOT` @@ -25,7 +25,7 @@ $ conda activate mortal ### Install pytorch pytorch is not listed as a dependency in `environment.yml` on purpose so that users can install it with their favored ways as per their requirement, hardware and OS. -Check [pytorch's doc](https://pytorch.org/get-started/locally/) on how to install pytorch in your environment. Personally, I recommand installing pytorch with pip. +Check [pytorch's doc](https://pytorch.org/get-started/locally/) on how to install pytorch in your environment. Personally, I recommend installing pytorch with pip. ```admonish tip Only `torch` is needed. You can skip the installation of `torchvision` and `torchaudio`. diff --git a/docs/src/user/docker.md b/docs/src/user/docker.md index 9eefb87..8b160f7 100644 --- a/docs/src/user/docker.md +++ b/docs/src/user/docker.md @@ -13,7 +13,7 @@ $ sudo env DOCKER_BUILDKIT=1 docker build -t mortal:latest . ``` ## Prepare a trained model -The Docker image does not contain any model file of Model, therefore it must be prepared separately under a directory, which will be demostrated as `/path/to/model/dir` below. In this example, snapshot `mortal1-b40c192-t22040618` is used. +The Docker image does not contain any model file of Model, therefore it must be prepared separately under a directory, which will be demonstrated as `/path/to/model/dir` below. In this example, snapshot `mortal1-b40c192-t22040618` is used. ## Example We are going to use Mortal to evaluate the next move for the scene shown in _Figure 1_. @@ -25,7 +25,7 @@ First things first, we need to identify the POV's player ID. A player ID is an i In this case, the POV's player ID is 2, because his seat is West at E1. -Mortal speaks mjai , a simple and easy-to-read stream format for mahjong records. From the perspective of player 2, the equivalant masked mjai events he has perceived so far are: +Mortal speaks mjai , a simple and easy-to-read stream format for mahjong records. From the perspective of player 2, the equivalent masked mjai events he has perceived so far are: ```js {"type":"start_game"} diff --git a/libriichi/src/state/action.rs b/libriichi/src/state/action.rs index 17dcbb2..40e42f0 100644 --- a/libriichi/src/state/action.rs +++ b/libriichi/src/state/action.rs @@ -122,7 +122,7 @@ impl PlayerState { if let Some(tile) = self.last_self_tsumo { ensure!(tile == pai, "cannot tsumogiri"); } else { - bail!("tsumogiri but the player has not dealed any tile yet"); + bail!("tsumogiri but the player has not dealt any tile yet"); } } } diff --git a/mortal/server.py b/mortal/server.py index 6cf9f10..5773db3 100644 --- a/mortal/server.py +++ b/mortal/server.py @@ -110,7 +110,7 @@ def drain(self): shutil.move(src, dst) drained_size = raw_count S.buffer_size = 0 - logging.info(f'files transfered to trainer: {drained_size}') + logging.info(f'files transferred to trainer: {drained_size}') logging.info(f'total buffer size: {S.buffer_size}') self.send_msg({ 'count': drained_size, diff --git a/typos.toml b/typos.toml new file mode 100644 index 0000000..649f927 --- /dev/null +++ b/typos.toml @@ -0,0 +1,2 @@ +[files] +extend-exclude = ["log-viewer/files/**"]