-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add file weight option #70
base: main
Are you sure you want to change the base?
Conversation
src/github.sh
Outdated
@@ -5,14 +5,16 @@ GITHUB_API_HEADER="Accept: application/vnd.github.v3+json" | |||
github::calculate_total_modifications() { | |||
local -r pr_number="${1}" | |||
local -r files_to_ignore="${2}" | |||
local -r changed_file_weight="${3:-0}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
existing pattern seems to be to set the default values in the actions.yml file rather than inline here
|
||
echo $((additions + deletions)) | ||
echo $((additions + deletions + (changed_files * changed_file_weight))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To use an example, if there's a 10 file change and the changed_file_weight
is set to 10, then we're adding an additional 100 lines to the calculated diff? Is that the intention?
If you're trying to calculate the complexity of the change, that might require understanding the number of line changes per total lines in all files. For example, a 100 line file having 30 lines changes would be complexity 30.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this change missing the else
block here when files_to_ignore
is set.
ccca251
to
a2b9cdb
Compare
Solves #69