Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions contentctl/input/director.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ class Colors:
DOCS = "📚" if sys.platform != "win32" else "?"
BULB = "💡" if sys.platform != "win32" else "i"
SEARCH = "🔍" if sys.platform != "win32" else "@"
SPARKLE = "✨" if sys.platform != "win32" else "*"
ZAP = "⚡" if sys.platform != "win32" else "!"


Expand Down Expand Up @@ -303,15 +304,18 @@ def createSecurityContent(
)

if len(validation_errors) > 0:
if sys.platform == "win32":
sys.stdout.reconfigure(encoding="utf-8")

print("\n") # Clean separation
print(f"{Colors.BOLD}{Colors.BRIGHT_MAGENTA}╔{'═' * 60}╗{Colors.END}")
print(
f"{Colors.BOLD}{Colors.BRIGHT_MAGENTA}║{Colors.BLUE}{f'{Colors.SEARCH} Content Validation Summary':^60}{Colors.BRIGHT_MAGENTA}║{Colors.END}"
f"{Colors.BOLD}{Colors.BRIGHT_MAGENTA}║{Colors.BLUE}{f'{Colors.SEARCH} Content Validation Summary':^59}{Colors.BRIGHT_MAGENTA}║{Colors.END}"
)
print(f"{Colors.BOLD}{Colors.BRIGHT_MAGENTA}╚{'═' * 60}╝{Colors.END}\n")

print(
f"{Colors.BOLD}{Colors.GREEN} Validation Completed{Colors.END} – Issues detected in {Colors.RED}{Colors.BOLD}{len(validation_errors)}{Colors.END} files.\n"
f"{Colors.BOLD}{Colors.GREEN}{Colors.SPARKLE} Validation Completed{Colors.END} – Issues detected in {Colors.RED}{Colors.BOLD}{len(validation_errors)}{Colors.END} files.\n"
)

for index, entry in enumerate(validation_errors, 1):
Expand All @@ -322,7 +326,7 @@ def createSecurityContent(
number_emoji = f"{index}️⃣"
print(f"{Colors.YELLOW}┏{'━' * width}┓{Colors.END}")
print(
f"{Colors.YELLOW}┃{Colors.BOLD} {number_emoji} File: {Colors.CYAN}{file_path}{Colors.END}{' ' * (width - len(str(file_path)) - 12)}{Colors.YELLOW}┃{Colors.END}"
f"{Colors.YELLOW}┃{Colors.BOLD} {number_emoji} File: {Colors.CYAN}{file_path}{Colors.END}{' ' * (width - len(str(file_path)) - 9)}{Colors.YELLOW}┃{Colors.END}"
)
print(f"{Colors.YELLOW}┗{'━' * width}┛{Colors.END}")

Expand Down Expand Up @@ -351,23 +355,25 @@ def createSecurityContent(
)
elif "Extra inputs" in error_msg:
print(
f" {Colors.BLUE} Unexpected Field: {err.get('loc', [''])[0]}{Colors.END}"
f" {Colors.BLUE}{Colors.ERROR} Unexpected Field: {err.get('loc', [''])[0]}{Colors.END}"
)
elif "Failed to find" in error_msg:
print(
f" {Colors.RED}🔍 Missing Reference: {error_msg}{Colors.END}"
f" {Colors.RED}{Colors.SEARCH} Missing Reference: {error_msg}{Colors.END}"
)
else:
print(f" {Colors.RED}❌ {error_msg}{Colors.END}")
print(
f" {Colors.RED}{Colors.ERROR} {error_msg}{Colors.END}"
)
else:
print(f" {Colors.RED} {str(error)}{Colors.END}")
print(f" {Colors.RED}{Colors.ERROR} {str(error)}{Colors.END}")
print("")

# Clean footer with next steps
max_width = max(60, max(len(str(e[0])) + 15 for e in validation_errors))
print(f"{Colors.BOLD}{Colors.CYAN}╔{'═' * max_width}╗{Colors.END}")
print(
f"{Colors.BOLD}{Colors.CYAN}║{Colors.BLUE}{'🎯 Next Steps':^{max_width}}{Colors.CYAN}║{Colors.END}"
f"{Colors.BOLD}{Colors.CYAN}║{Colors.BLUE}{Colors.ARROW + ' Next Steps':^{max_width - 1}}{Colors.CYAN}║{Colors.END}"
)
print(f"{Colors.BOLD}{Colors.CYAN}╚{'═' * max_width}╝{Colors.END}\n")

Expand Down
Loading