Skip to content

Commit 754a70a

Browse files
committed
re-add filter
1 parent 22fd04d commit 754a70a

File tree

1 file changed

+27
-25
lines changed

1 file changed

+27
-25
lines changed

docs/filter-functions.md

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ The following functions are supported in addition to the built-in functions prov
4242
| Function | Input | Args | Output |
4343
| ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- | -------------------------------------------------- | ----------------------- |
4444
| [`AI_DescribePR`](#AI_DescribePR)<br />Returns an AI-generated description of the PR based on the provided input diff | Object | - | String |
45+
| [`allDocs`](#alldocs)<br />Checks the list includes only images | [`files`](./context-variables.md#files) | - | Bool |
4546
| [`allImages`](#allimages)<br />Checks the list includes only images | [`files`](./context-variables.md#files) | - | Bool |
4647
| [`allTests`](#alltests)<br />Checks the list includes only tests | [`files`](./context-variables.md#files) | - | Bool |
4748
| [`codeExperts`](#codeexperts)<br />Get list of contributors based on expert reviewer model results | [`repo`](./context-variables.md#repo) | `gt`, `lt` | [String] |
@@ -314,31 +315,6 @@ Checks whether any element in the list is `true`. In case the list of elements
314315
{{ files | match(list=['src', 'dest']) | some }}
315316
```
316317

317-
#### `allDocs`
318-
319-
Return `true` if the input list includes only documents based on file extensions.
320-
321-
Doc files extensions are: `md`, `mkdown`, `txt`, `rst`, `adoc`, except for `requirements.txt`.
322-
323-
<div class="filter-details" markdown=1>
324-
325-
| Argument | Usage | Type | Description |
326-
| -------- | ---------|-----------|------------------------------------------------ |
327-
| - | Input | [`files`](./context-variables.md#files) | The list of changed files with their path |
328-
| - | Output | Bool | `true` if all file extensions are of docs |
329-
330-
</div>
331-
332-
```yaml+jinja
333-
{{ files | allDocs }}
334-
```
335-
336-
In case you want to exclude more files, like all `txt` under the `requirements` directory, add another check:
337-
338-
```yaml+jinja
339-
{{ (files | allDocs) and (files | match(regex=r/requirements\/.*\.txt$/) | nope ) }}
340-
```
341-
342318
#### `AI_DescribePR`
343319

344320
Leverage LinearB's AI to assist with generating a concise and meaningful description for pull requests based on the provided context. Streamline the review process by summarizing the purpose and key changes in a PR, reducing the manual effort and cognitive load for developers and reviewers.
@@ -366,6 +342,32 @@ automations:
366342

367343
```
368344
345+
#### `allDocs`
346+
347+
Return `true` if the input list includes only documents based on file extensions.
348+
349+
Doc files extensions are: `md`, `mkdown`, `txt`, `rst`, `adoc`, except for `requirements.txt`.
350+
351+
<div class="filter-details" markdown=1>
352+
353+
| Argument | Usage | Type | Description |
354+
| -------- | ---------|-----------|------------------------------------------------ |
355+
| - | Input | [`files`](./context-variables.md#files) | The list of changed files with their path |
356+
| - | Output | Bool | `true` if all file extensions are of docs |
357+
358+
</div>
359+
360+
```yaml+jinja
361+
{{ files | allDocs }}
362+
```
363+
364+
In case you want to exclude more files, like all `txt` under the `requirements` directory, add another check:
365+
366+
```yaml+jinja
367+
{{ (files | allDocs) and (files | match(regex=r/requirements\/.*\.txt$/) | nope ) }}
368+
```
369+
370+
369371
#### `allImages`
370372

371373
Return `true` if the input list includes only images based on file extensions.

0 commit comments

Comments
 (0)