Only targetting additions in the size
check
#453
-
Hi all! I'm wondering, is it possible to only target additions when doing a size check? We frequently have "cleanup" tech debt that result in lots of deleted code or documentation which don't necessarily need the same scrutiny as new code being added - so if we can just look at net new code that'll streamline our flow. I posit that we may be peculiar in this ask, so even if it as a configurable param that'd be much appreciated. Thanks very much! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Thanks for your question 🙌 As for the moment, size calculates the total amount of changed lines, which includes all added and removed lines. There's no configuration to count only the added or the removed lines. You can, however, provide a list of patterns to be ignored by size. Here's an example: api-version: reviewpad.com/v3.x
groups:
- name: exclude-patterns
spec: '["*.lock", "*.md", "folder/**", "**/file.js"]'
workflows:
- name: label-pull-request-with-size
if:
# Calcule size ignoring the files matched by "exclude-patterns"
- rule: $size($group("exclude-patterns")) < 30
extra-actions:
- $addLabel("small") What you are proposing here is to have a new built-in that provides the total amount of added lines, e.g. Let me know if this helps 🙂 Thanks |
Beta Was this translation helpful? Give feedback.
Hi @leo-mendoza-qatalog
Thanks for your question 🙌 As for the moment, size calculates the total amount of changed lines, which includes all added and removed lines. There's no configuration to count only the added or the removed lines.
You can, however, provide a list of patterns to be ignored by size.
Here's an example:
What you are…