Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 31 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Basic PR Quality Checks

on:
pull_request:
branches: [ "main", "dev" ]
types:
- opened
- edited
- reopened
- synchronize

permissions:
contents: read
pull-requests: write
issues: write
checks: write

jobs:
quality-checks:
name: Run Organization Quality Checks
uses: sessatakuma/org-workflows/.github/workflows/entrypoint.yml@main
secrets:
CHECKER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Basic PR Quality Checks (enabled by default)
run-basic-checks: true

# Python Code Quality Checks (optional - uncomment to enable)
# Requires: pyproject.toml with ruff and mypy configured
run-python-checks: true
python-version: '3.11'
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.venv
__pycache__/
secret.yaml
secret.yaml
.pre-commit-config.yaml
25 changes: 18 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# API-tools

> [!WARNING]
>
>
> This project is still under development!

This is a repository that implement several API interfaces for Discord BOT and web interface.
Expand All @@ -14,7 +14,7 @@ Currently we have 2 implemented APIs
5. Sentence Query API

> [!NOTE]
>
>
> The following document is only for developer, we will use Swagger UI to generate official API document.

1. Mark Accent
Expand All @@ -24,7 +24,7 @@ Currently we have 2 implemented APIs

`https://{TODO}/api/MarkAccent/`
- **Request Parameter (POST)**

> Note that we only accept POST request

| Parameter | Type | Explanation |
Expand All @@ -40,7 +40,7 @@ Currently we have 2 implemented APIs
```

- **Respond Parameter**

| Parameter | Type | Explanation |
| --------------- | ------ | ------------ |
| status | int | status code [Reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status#server_error_responses) |
Expand Down Expand Up @@ -136,7 +136,7 @@ Currently we have 2 implemented APIs

`https://{TODO}/api/MarkFurigana/`
- **Request Parameter (POST)**

> Note that we only accept POST request

| Parameter | Type | Explanation |
Expand All @@ -150,7 +150,7 @@ Currently we have 2 implemented APIs
"text": "漢字かな交じり文"
}
```

- **Respond Parameter**

| Parameter | Type | Explanation |
Expand Down Expand Up @@ -249,4 +249,15 @@ async def foo(
...
except httpx.HTTPError as e:
...
```
```


## Check the project
Since the package of ruff and mypy are already installed in dev group,
one can directly execute the following command to format and check the project:
```bash
ruff format . --check # Check format
ruff check . # Check linter
mypy . # Check type
```
For more detailed setting with IDE (e.g. VScode), please refer to our manul.
24 changes: 24 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,27 @@ dependencies = [
"requests>=2.32.5",
"uvicorn>=0.38.0",
]

[dependency-groups]
dev = [
"mypy>=1.18.2",
"pyyaml>=6.0.3",
"ruff>=0.14.2",
"toml>=0.10.2",
]

[tool.ruff.format]
quote-style = "double"
indent-style = "space"

[tool.ruff]
line-length = 88

[tool.ruff.lint]
select = ["E", "F", "N"]

[tool.mypy]
strict = true
namespace_packages = true
warn_unused_ignores = false
ignore_missing_imports = true
89 changes: 89 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 0 additions & 66 deletions workflows/pr-check.yml

This file was deleted.

Loading