From 5b2076fa33fc41d9b54d34b88c9f288759da817b Mon Sep 17 00:00:00 2001 From: shoucandanghehe Date: Fri, 1 Nov 2024 01:41:45 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9E=95=20=E6=B7=BB=E5=8A=A0=E5=BC=80?= =?UTF-8?q?=E5=8F=91=E4=BE=9D=E8=B5=96=20prettier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 11 +++++++++++ pnpm-lock.yaml | 22 ++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 package.json create mode 100644 pnpm-lock.yaml diff --git a/package.json b/package.json new file mode 100644 index 0000000..eb74ee2 --- /dev/null +++ b/package.json @@ -0,0 +1,11 @@ +{ + "prettier": { + "singleQuote": true, + "printWidth": 120, + "tabWidth": 2, + "endOfLine": "lf" + }, + "devDependencies": { + "prettier": "^3.3.3" + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..db4ba54 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,22 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + .: + devDependencies: + prettier: + specifier: ^3.3.3 + version: 3.3.3 + +packages: + prettier@3.3.3: + resolution: + { integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew== } + engines: { node: '>=14' } + hasBin: true + +snapshots: + prettier@3.3.3: {} From c5eabbc48709a8a1baa5ecf357a93c15fe69d916 Mon Sep 17 00:00:00 2001 From: shoucandanghehe Date: Fri, 1 Nov 2024 01:43:14 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=8E=A8=20=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/Release.yml | 6 +- .github/workflows/TypeCheck.yml | 4 +- .github/workflows/codeql-analysis.yml | 61 +++++++++---------- .pre-commit-config.yaml | 36 +++++------ CONTRIBUTING.en-US.md | 2 +- CONTRIBUTING.md | 4 +- .../i18n/.lang.schema.json | 2 +- 7 files changed, 57 insertions(+), 58 deletions(-) diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 11cd2ef..fc56414 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -3,7 +3,7 @@ name: Release CI on: push: tags: - - "*" + - '*' jobs: release: @@ -19,10 +19,10 @@ jobs: with: enable-cache: true - - name: "Set up Python" + - name: 'Set up Python' uses: actions/setup-python@v5 with: - python-version-file: ".python-version" + python-version-file: '.python-version' - run: uv sync shell: bash diff --git a/.github/workflows/TypeCheck.yml b/.github/workflows/TypeCheck.yml index ff3b7a1..1139d56 100644 --- a/.github/workflows/TypeCheck.yml +++ b/.github/workflows/TypeCheck.yml @@ -14,10 +14,10 @@ jobs: with: enable-cache: true - - name: "Set up Python" + - name: 'Set up Python' uses: actions/setup-python@v5 with: - python-version-file: ".python-version" + python-version-file: '.python-version' - run: uv sync shell: bash diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index b811247..284bfb0 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -9,14 +9,14 @@ # the `language` matrix defined below to confirm you have the correct set of # supported CodeQL languages. # -name: "CodeQL" +name: 'CodeQL' on: push: - branches: [ main ] + branches: [main] pull_request: # The branches below must be a subset of the branches above - branches: [ main ] + branches: [main] schedule: - cron: '17 6 * * 5' @@ -32,41 +32,40 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'python' ] + language: ['python'] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support steps: - - name: Checkout repository - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v3 + # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality - # ℹ️ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v3 - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + # ℹ️ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dbf3be2..c1d0cfb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,22 +1,22 @@ default_install_hook_types: [pre-commit, prepare-commit-msg] ci: - autofix_commit_msg: ':rotating_light: auto fix by pre-commit hooks' - autofix_prs: true - autoupdate_branch: main - autoupdate_schedule: weekly - autoupdate_commit_msg: ':arrow_up: auto update by pre-commit hooks' + autofix_commit_msg: ':rotating_light: auto fix by pre-commit hooks' + autofix_prs: true + autoupdate_branch: main + autoupdate_schedule: weekly + autoupdate_commit_msg: ':arrow_up: auto update by pre-commit hooks' repos: - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.1 - hooks: - - id: ruff - args: [--fix, --exit-non-zero-on-fix] - stages: [pre-commit] - - id: ruff-format - stages: [pre-commit] + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.7.1 + hooks: + - id: ruff + args: [--fix, --exit-non-zero-on-fix] + stages: [pre-commit] + - id: ruff-format + stages: [pre-commit] - - repo: https://github.com/nonebot/nonemoji - rev: v0.1.4 - hooks: - - id: nonemoji - stages: [prepare-commit-msg] + - repo: https://github.com/nonebot/nonemoji + rev: v0.1.4 + hooks: + - id: nonemoji + stages: [prepare-commit-msg] diff --git a/CONTRIBUTING.en-US.md b/CONTRIBUTING.en-US.md index 9ef9e7a..ce716a2 100644 --- a/CONTRIBUTING.en-US.md +++ b/CONTRIBUTING.en-US.md @@ -42,7 +42,7 @@ This project uses [Tarina](https://github.com/ArcletProject/Tarina) for internat #### Adding a New Language 1. Navigate to the `./nonebot_plugin_tetris_stats/i18n/` directory. -2. Run `tarina-lang create {language_code}` * Please note that the language code should preferably follow the [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) standard. +2. Run `tarina-lang create {language_code}` \* Please note that the language code should preferably follow the [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) standard. 3. Edit the generated `./nonebot_plugin_tetris_stats/i18n/{language_code}.json` file. #### Updating an Existing Language diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e781269..c1d9b62 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,7 +24,7 @@ uv sync 1. 代码静态检查使用 [ruff](https://docs.astral.sh/ruff/),你可以为你的ide安装对应插件来使用,也可以在命令行使用`ruff check ./nonebot_plugin_tetris_stats/`来检查代码。 2. 代码格式化使用 [ruff](https://docs.astral.sh/ruff/),你可以为你的ide安装对应插件来使用,也可以在命令行使用`ruff format ./nonebot_plugin_tetris_stats/`来格式化代码。 3. 类型检查同时使用 [basedpyright](https://docs.basedpyright.com/latest/) 和 [mypy](https://www.mypy-lang.org/),你可以为你的ide安装对应插件来使用。 -也可以在命令行使用下面的命令来检查代码: + 也可以在命令行使用下面的命令来检查代码: ```bash # basedpyright @@ -41,7 +41,7 @@ mypy ./nonebot_plugin_tetris_stats/ #### 添加新的语言 1. 进入 `./nonebot_plugin_tetris_stats/i18n/` 目录。 -2. 运行 `tarina-lang create {语言代码}` * 请注意,语言代码最好符合 [IETF语言标签](https://zh.wikipedia.org/wiki/IETF%E8%AF%AD%E8%A8%80%E6%A0%87%E7%AD%BE) 的规范。 +2. 运行 `tarina-lang create {语言代码}` \* 请注意,语言代码最好符合 [IETF语言标签](https://zh.wikipedia.org/wiki/IETF%E8%AF%AD%E8%A8%80%E6%A0%87%E7%AD%BE) 的规范。 3. 编辑生成的 `./nonebot_plugin_tetris_stats/i18n/{语言代码}.json` 文件。 #### 更新已有语言 diff --git a/nonebot_plugin_tetris_stats/i18n/.lang.schema.json b/nonebot_plugin_tetris_stats/i18n/.lang.schema.json index 96bce4f..00d543d 100644 --- a/nonebot_plugin_tetris_stats/i18n/.lang.schema.json +++ b/nonebot_plugin_tetris_stats/i18n/.lang.schema.json @@ -69,4 +69,4 @@ } } } -} \ No newline at end of file +}