Skip to content

Commit

Permalink
Merge pull request #57 from bun913/feat/update-rule-yml
Browse files Browse the repository at this point in the history
Update Rule(Bedrock/CodeWhisperer)
  • Loading branch information
bun913 authored May 2, 2023
2 parents 3e3db70 + 65f8641 commit 53db8cf
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/update_dict.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ permissions:

on:
schedule:
- cron: '0 21 * * *' # 日本時間の午前6時に実行する
- cron: '0 21 1 * *' # 毎月1日の日本時間の午前6時に実行する
workflow_dispatch:

jobs:
Expand Down
21 changes: 21 additions & 0 deletions dict/auto-create-regular-rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@ rules:
- AWS Aurora
options:
wordBoundary: true
- expected: Bedrock
options:
wordBoundary: true
- expected: Amazon Bedrock
patterns:
- AWS Bedrock
options:
wordBoundary: true
- expected: Braket
options:
wordBoundary: true
Expand Down Expand Up @@ -2769,3 +2777,16 @@ rules:
- VMwareCloudonAWS
options:
wordBoundary: true
- expected: CodeWhisperer
options:
wordBoundary: true
- expected: Amazon CodeWhisperer
patterns:
- AWS CodeWhisperer
options:
wordBoundary: true
- expected: CodeWhisperer
patterns:
- Code Whisperer
options:
wordBoundary: true
44 changes: 41 additions & 3 deletions test/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import TextLintTester from "textlint-tester";
import * as lint from "../src/index";

const report = lint.default.fixer
const report = lint.default.fixer;
const tester = new TextLintTester();
tester.run("EC2", report, {
valid: ["EC2", "Amazon EC2"],
Expand Down Expand Up @@ -51,7 +51,9 @@ tester.run("Security Hub", report, {
text: "SecurityHub",
errors: [
{
message: "SecurityHub => Security Hub", }, ],
message: "SecurityHub => Security Hub",
},
],
description: "Not Allowed delete blank",
},
],
Expand Down Expand Up @@ -89,6 +91,42 @@ tester.run("Glue DataBrew", report, {
message: "Glue databrew => Glue DataBrew",
},
],
}
},
],
});

tester.run("Bedrock", report, {
valid: ["Amazon Bedrock"],
invalid: [
{
text: "AWS Bedrock",
errors: [
{
message: "AWS Bedrock => Amazon Bedrock",
},
],
},
],
});

tester.run("CodeWhisperer", report, {
valid: ["Amazon CodeWhisperer"],
invalid: [
{
text: "AWS CodeWhisperer",
errors: [
{
message: "AWS CodeWhisperer => Amazon CodeWhisperer",
},
],
},
{
text: "Code Whisperer",
errors: [
{
message: "Code Whisperer => CodeWhisperer",
},
],
},
],
});

0 comments on commit 53db8cf

Please sign in to comment.