Skip to content

Commit ae862d9

Browse files
authored
Merge pull request #2771 from Flow-Launcher/update_gitstream
Add gitStream new code, todo comments and screenshot automations
2 parents 199210e + bdead70 commit ae862d9

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.cm/gitstream.cm

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,38 @@ automations:
2323
- action: explain-code-experts@v1
2424
args:
2525
gt: 10
26+
# Post a comment that indicates what percentage of the PR is new code.
27+
percent_new_code:
28+
if:
29+
- true
30+
run:
31+
- action: add-comment@v1
32+
args:
33+
comment: |
34+
This PR is {{ changes.ratio }}% new code.
35+
# Post a comment that request changes for a PR that contains a TODO statement.
36+
review_todo_comments:
37+
if:
38+
- {{ source.diff.files | matchDiffLines(regex=r/^[+].*(TODO)|(todo)/) | some }}
39+
run:
40+
- action: request-changes@v1
41+
args:
42+
comment: |
43+
This PR contains a TODO statement. Please check to see if they should be removed.
44+
# Post a comment that request a before and after screenshot
45+
request_screenshot:
46+
# Triggered for PRs that lack an image file or link to an image in the PR description
47+
if:
48+
- {{ not (has.screenshot_link or has.image_uploaded) }}
49+
run:
50+
- action: add-label@v1
51+
args:
52+
label: 'no-screenshot'
53+
color: '#FF000A'
54+
- action: add-comment@v1
55+
args:
56+
comment: |
57+
Be a legend :trophy: by adding a before and after screenshot of the changes you made, especially if they are around UI/UX.
2658
2759
2860
# +----------------------------------------------------------------------------+
@@ -37,3 +69,11 @@ colors:
3769
red: 'b60205'
3870
yellow: 'fbca04'
3971
green: '0e8a16'
72+
73+
changes:
74+
# Sum all the lines added/edited in the PR
75+
additions: {{ branch.diff.files_metadata | map(attr='additions') | sum }}
76+
# Sum all the line removed in the PR
77+
deletions: {{ branch.diff.files_metadata | map(attr='deletions') | sum }}
78+
# Calculate the ratio of new code
79+
ratio: {{ (changes.additions / (changes.additions + changes.deletions)) * 100 | round(2) }}

0 commit comments

Comments
 (0)