-
Notifications
You must be signed in to change notification settings - Fork 6
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
Added support for linter feedback enable/disable and output path for … #43
Conversation
Code Review Agent Run Status
|
/review |
Code Review Agent Run #1c80adActionable Suggestions - 1
Review Details
|
Changelist by BitoThis pull request implements the following key changes.
|
@@ -528,7 +532,7 @@ foreach ($param in $required_params) { | |||
foreach ($param in $optional_params) { | |||
if ($param -eq "dependency_check.snyk_auth_token" -and $props["dependency_check"] -eq "True") { | |||
Ask-For-Param $param $false | |||
} elseif ($param -ne "dependency_check.snyk_auth_token" -and $param -ne "env" -and $param -ne "cli_path" -and $param -ne "output_path" -and $param -ne "static_analysis_tool" -and $param -ne "git.domain" -and $param -ne "review_scope" -and $param -ne "exclude_branches" -and $param -ne "exclude_files" -and $param -ne "exclude_draft_pr" -and $param -ne "cr_event_type" -and $param -ne "posting_to_pr" -and $param -ne "custom_rules.configured_ws_ids" -and $param -ne "custom_rules.aws_access_key_id" -and $param -ne "custom_rules.aws_secret_access_key" -and $param -ne "custom_rules.region_name" -and $param -ne "custom_rules.bucket_name" -and $param -ne "custom_rules.aes_key") { | |||
} elseif ($param -ne "dependency_check.snyk_auth_token" -and $param -ne "env" -and $param -ne "cli_path" -and $param -ne "output_path" -and $param -ne "static_analysis_tool" -and $param -ne "linters_feedback" -and $param -ne "git.domain" -and $param -ne "review_scope" -and $param -ne "exclude_branches" -and $param -ne "exclude_files" -and $param -ne "exclude_draft_pr" -and $param -ne "cr_event_type" -and $param -ne "posting_to_pr" -and $param -ne "custom_rules.configured_ws_ids" -and $param -ne "custom_rules.aws_access_key_id" -and $param -ne "custom_rules.aws_secret_access_key" -and $param -ne "custom_rules.region_name" -and $param -ne "custom_rules.bucket_name" -and $param -ne "custom_rules.aes_key" -and $param -ne "code_context_config.partial_timeout" -and $param -ne "code_context_config.max_depth" -and $param -ne "code_context_config.kill_timeout_sec") { |
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.
Consider breaking down the long condition into smaller, more manageable parts. This could improve readability and maintainability. You might consider using an array of parameters to check against or a separate function for parameter validation. A similar issue was also found in cra-scripts/bito-cra.sh (line 543).
Code suggestion
@@ -535,1 +535,10 @@
- } elseif ($param -ne "dependency_check.snyk_auth_token" -and $param -ne "env" -and $param -ne "cli_path" -and $param -ne "output_path" -and $param -ne "static_analysis_tool" -and $param -ne "linters_feedback" -and $param -ne "git.domain" -and $param -ne "review_scope" -and $param -ne "exclude_branches" -and $param -ne "exclude_files" -and $param -ne "exclude_draft_pr" -and $param -ne "cr_event_type" -and $param -ne "posting_to_pr" -and $param -ne "custom_rules.configured_ws_ids" -and $param -ne "custom_rules.aws_access_key_id" -and $param -ne "custom_rules.aws_secret_access_key" -and $param -ne "custom_rules.region_name" -and $param -ne "custom_rules.bucket_name" -and $param -ne "custom_rules.aes_key" -and $param -ne "code_context_config.partial_timeout" -and $param -ne "code_context_config.max_depth" -and $param -ne "code_context_config.kill_timeout_sec") {
+ } elseif (Is-ValidParam $param) {
+
+function Is-ValidParam($param) {
+ $excludedParams = @("dependency_check.snyk_auth_token", "env", "cli_path", "output_path", "static_analysis_tool", "linters_feedback", "git.domain", "review_scope", "exclude_branches", "exclude_files", "exclude_draft_pr", "cr_event_type", "posting_to_pr", "custom_rules.configured_ws_ids", "custom_rules.aws_access_key_id", "custom_rules.aws_secret_access_key", "custom_rules.region_name", "custom_rules.bucket_name", "custom_rules.aes_key", "code_context_config.partial_timeout", "code_context_config.max_depth", "code_context_config.kill_timeout_sec")
+ return $excludedParams -notcontains $param
+}
Code Review Run #1c80ad
Is this a valid issue, or was it incorrectly flagged by the Agent?
- it was incorrectly flagged
Code Review Agent Run Status
|
Code Review Agent Run Status
|
Summary by Bito
This PR adds support for enabling/disabling linter feedback and specifying an output path in the CRA tool. It updates configuration properties and scripts to handle new parameters for linter feedback and custom rules. The changes primarily affect the configuration file and PowerShell/shell scripts used to run the CRA.Unit tests added: False
Estimated effort to review (1-5, lower is better): 2