Skip to content
This repository has been archived by the owner on Dec 8, 2023. It is now read-only.

Commit

Permalink
fix: expand no_commented_out_code tests (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
morgante authored Dec 6, 2023
1 parent 63aa2c5 commit 59a52b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .grit/patterns/ai_match.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Ask an AI
# AI conditions.

GritQL can use an AI for fuzzy matching. Just match the node you wish to analyze against the `ai_is` pattern.

tags: #ai, #sample, #util, #hidden

```grit
`console.log($msg)` => `// REDACTED: $msg` where {
$msg <: ai_is(condition="references personally identifiable information")
$msg <: ai_is("references personally identifiable information")
}
```

Expand Down
14 changes: 8 additions & 6 deletions .grit/patterns/no_commented_out_code.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@ file($body) where {
},
$blocks = group_blocks(target=$comments),
$blocks <: some bubble $block where {
// TODO: insert smarter context here
// $condition = after $block,
$block <: ai_is(condition="commented out code that is valid JavaScript, not a descriptive comment"),
$block <: ai_is("commented out code that is valid JavaScript, not a descriptive comment"),
// Remove the block
// TODO: support $block => .
$block <: some bubble $comment => .
}
}
Expand Down Expand Up @@ -88,8 +85,6 @@ var times = (x, y) => {
if (name === 'grpc.google.logging.v2.LoggingServiceV2/WriteLogEntries') return RATE_DROP;
```

# Disabled tests

## Handles block comments too

Block comments don't currently parse correctly, see https://github.com/getgrit/rewriter/issues/7731.
Expand All @@ -103,3 +98,10 @@ export const createSdkActivities = () => {
return new Proxy(stdlib, {});
};
```

```js
/** See sdk_proxy for how stdlib calls are intercepted and the workflow ID is injected. */
export const createSdkActivities = () => {
return new Proxy(stdlib, {});
};
```

0 comments on commit 59a52b1

Please sign in to comment.