refactor(banner): remove unneeded arguments (#4155)

This commit is contained in:
Pepe Fagoaga
2024-06-03 14:44:14 +02:00
committed by GitHub
parent 0bbb762c74
commit b33b529e74
3 changed files with 14 additions and 4 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ from prowler.lib.banner import print_banner
warnings.filterwarnings("ignore")
cli = sys.modules["flask.cli"]
print_banner(verbose=False)
print_banner()
print(
f"{Fore.GREEN}Loading all CSV files from the folder {folder_path_overview} ...\n{Style.RESET_ALL}"
)
+2 -1
View File
@@ -89,7 +89,8 @@ def prowler():
)
if not args.no_banner:
print_banner(args.verbose, getattr(args, "fixer", None))
legend = args.verbose or getattr(args, "fixer", None)
print_banner(legend)
# We treat the compliance framework as another output format
if compliance_framework:
+11 -2
View File
@@ -3,7 +3,16 @@ from colorama import Fore, Style
from prowler.config.config import banner_color, orange_color, prowler_version, timestamp
def print_banner(verbose: bool, fixer: bool = False):
def print_banner(legend: bool = False):
"""
Prints the banner with optional legend for color codes.
Parameters:
- legend (bool): Flag to indicate whether to print the color legend or not. Default is False.
Returns:
- None
"""
banner = rf"""{banner_color} _
_ __ _ __ _____ _| | ___ _ __
| '_ \| '__/ _ \ \ /\ / / |/ _ \ '__|
@@ -15,7 +24,7 @@ def print_banner(verbose: bool, fixer: bool = False):
"""
print(banner)
if verbose or fixer:
if legend:
print(
f"""
{Style.BRIGHT}Color code for results:{Style.RESET_ALL}