-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[chore] Prepare fiest release #4
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Changesets | ||
|
||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works | ||
with multi-package repos, or single-package repos to help you version and publish your code. You can | ||
find the full documentation for it [in our repository](https://github.com/changesets/changesets) | ||
|
||
We have a quick list of common questions to get you started engaging with this project in | ||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": "@changesets/cli/changelog", | ||
"commit": false, | ||
"fixed": [], | ||
"linked": [], | ||
"access": "restricted", | ||
"baseBranch": "main", | ||
"updateInternalDependencies": "patch", | ||
"ignore": [] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"ai-craftsman": minor | ||
--- | ||
|
||
Initial release |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
issues: write | ||
pull-requests: write | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: "pnpm" | ||
|
||
- name: prebuild | ||
run: pnpm install --frozen-lockfile | ||
|
||
- name: Build | ||
run: cd packages/ai-craftsman && pnpm build | ||
|
||
- name: Zip output | ||
run: zip release *.* | ||
|
||
- uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: "release.zip" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: "AI Craftsman" | ||
description: "Fully customizable AI reviewer" | ||
inputs: | ||
BASE_REF: | ||
description: "Value of github.base_ref" | ||
required: true | ||
OPENAI_API_KEY: | ||
description: "OpenAI API Key" | ||
required: true | ||
GITHUB_TOKEN: | ||
description: "Value of secrets.GITHUB_TOKEN" | ||
required: true | ||
GITHUB_EVENT_PATH: | ||
description: "Value of github.event_path" | ||
required: true | ||
LANGUAGE: | ||
description: "Your preferred language. Example: English" | ||
required: false | ||
default: "English" | ||
DEBUG: | ||
description: "Set true to enable debug mode" | ||
required: false | ||
CODING_GUIDE_PATH: | ||
description: "File path of the coding guide. Relative path from the project root." | ||
required: false | ||
CODING_GUIDE_LEVEL: | ||
description: "Hierarchy of markdowns representing each rule." | ||
required: false | ||
CODING_GUIDE_ENABLE_PATTERN: | ||
description: "Regular expression patterns for rules that enable review by AI." | ||
required: false | ||
default: ".*" | ||
CODING_GUIDE_READER: | ||
description: "File path of the custom script that returns each rule" | ||
required: false | ||
runs: | ||
using: "node20" | ||
main: "packages/ai-craftsman/dist/bin.js" |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -29,5 +29,8 @@ export const env = { | |||||||||
reader: getEnv("CODING_GUIDE_READER") || undefined, | ||||||||||
path: getEnv("CODING_GUIDE_PATH") || undefined, | ||||||||||
Comment on lines
29
to
30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 各変数に対して型が明示的に指定されていません。型を明示的に宣言することで、コンパイル時の型チェックの恩恵を受けられ、ランタイムエラーのリスクを減らします。また、コードの意図が明確になり、他の開発者がコードを理解しやすくなります。以下のように修正してください。 reader: string | undefined = getEnv("CODING_GUIDE_READER") || undefined,
path: string | undefined = getEnv("CODING_GUIDE_PATH") || undefined,
level: number | undefined = Number(getEnv("CODING_GUIDE_LEVEL")) || undefined,
enablePattern: RegExp = RegExp(
getEnv("CODING_GUIDE_ENABLE_PATTERN", { defaultValue: ".*" })
), Reference: ## 型定義の適用
説明全ての変数、関数の引数、および戻り値には明示的な型またはインターフェースを指定すること。 理由型を明示的に宣言することで、コンパイル時の型チェックの恩恵を受けられ、ランタイムエラーのリスクを減らします。また、コードの意図が明確になり、他の開発者がコードを理解しやすくなります。 例// 良いコードの例
function add(x: number, y: number): number {
return x + y;
}
// 悪いコードの例
function add(x, y) {
return x + y;
} 例外ケース
リファクタリングガイドライン既存のコードでは、任意の型が使われていた場合、それを具体的な型に置き換えていく。新規コードでは初めから型を適用する。 |
||||||||||
level: Number(getEnv("CODING_GUIDE_LEVEL")) || undefined, | ||||||||||
enablePattern: RegExp( | ||||||||||
getEnv("CODING_GUIDE_ENABLE_PATTERN", { defaultValue: ".*" }) | ||||||||||
), | ||||||||||
}, | ||||||||||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
全ての変数、関数の引数、および戻り値には明示的な型またはインターフェースを指定することが必要です。ここでは、
markdown
、parsed
、chunked
の変数と、chunkMarkdownByLevel
関数の引数と戻り値の型が指定されていません。これらに適切な型を指定してください。Reference: ## 型定義の適用
説明
全ての変数、関数の引数、および戻り値には明示的な型またはインターフェースを指定すること。
理由
型を明示的に宣言することで、コンパイル時の型チェックの恩恵を受けられ、ランタイムエラーのリスクを減らします。また、コードの意図が明確になり、他の開発者がコードを理解しやすくなります。
例
例外ケース
リファクタリングガイドライン
既存のコードでは、任意の型が使われていた場合、それを具体的な型に置き換えていく。新規コードでは初めから型を適用する。