Skip to content

Commit 227bbdb

Browse files
Merge pull request #43 from gitbito/release/1.6.6
Added support for linter feedback enable/disable and output path for …
2 parents 70c5e71 + 1fbaca1 commit 227bbdb

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

cra-scripts/bito-cra.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ git.access_token=
77
git.domain=
88
static_analysis=True
99
static_analysis_tool=fb_infer,astral_ruff,mypy
10+
linters_feedback=True
1011
review_scope=
1112
dependency_check=False
1213
code_context=True

cra-scripts/bito-cra.ps1

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ function Check-OutputDirectory {
232232
exit 1
233233
}
234234

235+
Write-Host "Output path: $output_path"
235236
#return valid cli directory
236237
return $output_path
237238
}
@@ -406,6 +407,7 @@ $optional_params_cli = @(
406407
"review_comments",
407408
"static_analysis",
408409
"static_analysis_tool",
410+
"linters_feedback",
409411
"review_scope",
410412
"exclude_branches",
411413
"exclude_files",
@@ -441,6 +443,7 @@ $optional_params_server = @(
441443
"review_comments",
442444
"static_analysis",
443445
"static_analysis_tool",
446+
"linters_feedback",
444447
"review_scope",
445448
"exclude_branches",
446449
"exclude_files",
@@ -460,6 +463,7 @@ $optional_params_server = @(
460463
"custom_rules.region_name"
461464
"custom_rules.bucket_name"
462465
"custom_rules.aes_key"
466+
"output_path"
463467
)
464468

465469
$bee_params = @(
@@ -528,7 +532,7 @@ foreach ($param in $required_params) {
528532
foreach ($param in $optional_params) {
529533
if ($param -eq "dependency_check.snyk_auth_token" -and $props["dependency_check"] -eq "True") {
530534
Ask-For-Param $param $false
531-
} 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") {
535+
} 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") {
532536
Ask-For-Param $param $false
533537
}
534538
}
@@ -554,6 +558,9 @@ foreach ($param in $required_params + $bee_params + $optional_params) {
554558
$docker_cmd += " --static_analysis.fb_infer.enabled=$validated_boolean"
555559
} elseif ($param -eq "static_analysis_tool") {
556560
$docker_cmd += " --$param=$($props[$param])"
561+
} elseif ($param -eq "linters_feedback") {
562+
$validated_boolean = Validate-Boolean $props[$param]
563+
$docker_cmd += " --$param=$validated_boolean"
557564
} elseif ($param -eq "review_scope") {
558565
$scopes = $($props[$param]) -replace ',\s*', ','
559566
$docker_cmd += " --$param='[$scopes]'"

cra-scripts/bito-cra.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ check_output_directory() {
220220
echo "output path directory not found!"
221221
return 1
222222
else
223-
echo $output_path
223+
echo "Output Path: $output_path"
224224
return 0
225225
fi
226226
}
@@ -416,6 +416,7 @@ optional_params_cli=(
416416
"review_comments"
417417
"static_analysis"
418418
"static_analysis_tool"
419+
"linters_feedback"
419420
"review_scope"
420421
"exclude_branches"
421422
"exclude_files"
@@ -452,6 +453,7 @@ optional_params_server=(
452453
"review_comments"
453454
"static_analysis"
454455
"static_analysis_tool"
456+
"linters_feedback"
455457
"review_scope"
456458
"exclude_branches"
457459
"exclude_files"
@@ -472,6 +474,7 @@ optional_params_server=(
472474
"custom_rules.region_name"
473475
"custom_rules.bucket_name"
474476
"custom_rules.aes_key"
477+
"output_path"
475478
)
476479

477480
bee_params=(
@@ -537,7 +540,7 @@ done
537540
for param in "${optional_params[@]}"; do
538541
if [ "$param" == "dependency_check.snyk_auth_token" ] && [ "${props["dependency_check"]}" == "True" ]; then
539542
ask_for_param "$param" "False"
540-
elif [ "$param" != "dependency_check.snyk_auth_token" ] && [ "$param" != "env" ] && [ "$param" != "cli_path" ] && [ "$param" != "output_path" ] && [ "$param" != "static_analysis_tool" ] && [ "$param" != "git.domain" ] && [ "$param" != "review_scope" ] && [ "$param" != "exclude_branches" ] && [ "$param" != "nexus_url" ] && [ "$param" != "exclude_files" ] && [ "$param" != "exclude_draft_pr" ] && [ "$param" != "cr_event_type" ] && [ "$param" != "posting_to_pr" ] && [ "$param" != "custom_rules.configured_ws_ids" ] && [ "$param" != "custom_rules.aws_access_key_id" ] && [ "$param" != "custom_rules.aws_secret_access_key" ] && [ "$param" != "custom_rules.region_name" ] && [ "$param" != "custom_rules.bucket_name" ] && [ "$param" != "custom_rules.aes_key" ]; then
543+
elif [ "$param" != "dependency_check.snyk_auth_token" ] && [ "$param" != "env" ] && [ "$param" != "cli_path" ] && [ "$param" != "output_path" ] && [ "$param" != "static_analysis_tool" ] && [ "$param" != "linters_feedback" ] && [ "$param" != "git.domain" ] && [ "$param" != "review_scope" ] && [ "$param" != "exclude_branches" ] && [ "$param" != "nexus_url" ] && [ "$param" != "exclude_files" ] && [ "$param" != "exclude_draft_pr" ] && [ "$param" != "cr_event_type" ] && [ "$param" != "posting_to_pr" ] && [ "$param" != "custom_rules.configured_ws_ids" ] && [ "$param" != "custom_rules.aws_access_key_id" ] && [ "$param" != "custom_rules.aws_secret_access_key" ] && [ "$param" != "custom_rules.region_name" ] && [ "$param" != "custom_rules.bucket_name" ] && [ "$param" != "custom_rules.aes_key" ] && [ "$param" != "code_context_config.partial_timeout" ] && [ "$param" != "code_context_config.max_depth" ] && [ "$param" != "code_context_config.kill_timeout_sec" ]; then
541544
ask_for_param "$param" "False"
542545
fi
543546
done
@@ -569,6 +572,9 @@ for param in "${required_params[@]}" "${bee_params[@]}" "${optional_params[@]}";
569572
docker_cmd+=" --static_analysis.fb_infer.enabled=${props[$param]}"
570573
elif [ "$param" == "static_analysis_tool" ]; then
571574
docker_cmd+=" --static_analysis_tool=${props[$param]}"
575+
elif [ "$param" == "linters_feedback" ]; then
576+
props[$param]=$(validate_boolean "${props[$param]}")
577+
docker_cmd+=" --linters_feedback=${props[$param]}"
572578
elif [ "$param" == "review_scope" ]; then
573579
scopes=$(echo ${props[$param]} | sed 's/, */,/g')
574580
docker_cmd+=" --review_scope='[$scopes]'"

0 commit comments

Comments
 (0)