Skip to content

Commit

Permalink
Merge pull request #467 from linear-b/check-new-files
Browse files Browse the repository at this point in the history
check if new python files added
  • Loading branch information
PavelLinearB authored Mar 5, 2024
2 parents 3a0cc44 + 16ec075 commit c8f37d4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions docs/filter-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,23 @@ Creates a shallow copy of a portion of a given list, filtered down to just the e

</div>

For example, check if all changes to JavaScript files are in tests directory:
Examples:
Check if all changes to JavaScript files are in the tests directory:

```yaml+jinja
{{ files | filter(regex=r/\.js$/) | match(regex=r/tests\//) | every }}
```

For example, check if all changes to JavaScript files are formatting:
Check if all changes to JavaScript files are formatting:

```yaml+jinja
{{ source.diff.files | filter(attr='new_file', regex=r/\.js$/) | isFormattingChange }}
```

Check if the PR has new Python files:
```yaml+jinja
{{ branch.diff.files_metadata | filter(attr='original_file', regex=r/^$/) | filter(attr='new_file', regex=r/\.py$/) | some }}
```
#### `includes`

Determines whether a string includes a certain substring. You can use either a single term, regex, or a list of terms to match with.
Expand Down

0 comments on commit c8f37d4

Please sign in to comment.