Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions .Jules/palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@
## 2026-06-30 - Added Emojis to CLI Output Messages
**Learning:** Adding subtle emojis to informative CLI output headers (like "Created/updated files" and "Next steps") provides clearer visual cues for developers scanning long CLI output.
**Action:** Always include relevant emojis in summary output text to make success and informational messages more visually distinguishable from routine command logs.

## 2026-07-03 - Conditional Emojis in CLI Output Messages
**Learning:** Hard-coded emojis in CLI output messages can break integrations with tools that do not support unicode and look bad in environments that don't support modern unicode.
**Action:** When adding emojis to terminal output, conditionally remove them if `APPGUARDRAIL_NO_EMOJI` environment variable is set.
6 changes: 6 additions & 0 deletions get_hint_lines.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
with open("scanner/cli/appguardrail.py", "r") as f:
lines = f.readlines()

for i, line in enumerate(lines):
if "πŸ’‘ Hint:" in line:
print(f"{i+1}: {line.strip()}")
3 changes: 3 additions & 0 deletions get_imports.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
with open("scanner/cli/appguardrail.py", "r") as f:
for i in range(20):
print(f.readline().strip())
17 changes: 17 additions & 0 deletions get_print_lines.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import re

with open("scanner/cli/appguardrail.py", "r") as f:
content = f.read()

emojis = [
"βœ…", "✨", "πŸš€", "πŸ’‘", "βš™οΈ", "❌", "🧭", "🧩", "πŸ”Ž", "🐍",
"🌐", "🧾", "πŸ”΄", "πŸ”΅", "🟠", "🟑", "⏭️", "πŸ”", "⚠️", "⚑",
"βš™", "⚠", "─", "═"
]

lines = content.split('\n')
for i, line in enumerate(lines):
if "print(" in line:
has_emoji = any(e in line for e in emojis)
if has_emoji:
print(f"{i+1}: {line.strip()}")
Empty file added out2.log
Empty file.
4,376 changes: 4,376 additions & 0 deletions out3.log

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions patch_appguardrail_emoji.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import re

with open("scanner/cli/appguardrail.py", "r") as f:
content = f.read()

emojis = [
"βœ…", "✨", "πŸš€", "πŸ’‘", "βš™οΈ", "❌", "🧭", "🧩", "πŸ”Ž", "🐍",
"🌐", "🧾", "πŸ”΄", "πŸ”΅", "🟠", "🟑", "⏭️", "πŸ”", "⚠️", "⚑",
"βš™", "⚠"
]

patch_template = """
def strip_emoji(text):
if not bool(os.getenv("APPGUARDRAIL_NO_EMOJI")):
return text
for e in {emojis}:
text = text.replace(e + " ", "")
text = text.replace(e + " ", "")
text = text.replace(e, "")
return text
"""
patch = patch_template.format(emojis=str(emojis))

# Inject after imports
content = content.replace("from pathlib import Path", "from pathlib import Path\nimport os\n" + patch)

# Find all print statements with strings containing emojis
# and wrap the string argument with strip_emoji()
def replacer(match):
# This is a complex regex task, might be easier to just conditionally replace print globally inside the file using string manipulation
pass

with open("scanner/cli/appguardrail.py", "w") as f:
f.write(content)
25 changes: 25 additions & 0 deletions patch_plural.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import re

with open("scanner/cli/appguardrail.py", "r") as f:
content = f.read()

# Replace pluralizations:
# files_word
# critical_word
# high_word
# warnings_word
# info_word
# finding_word
# issue_word
# these_word

patch_plurals = """
files_word = "file" if files_scanned == 1 else "files"
critical_word = "critical issue" if counts["CRITICAL"] == 1 else "critical issues"
high_word = "high issue" if counts["HIGH"] == 1 else "high issues"
warnings_word = "warning" if counts["WARNING"] == 1 else "warnings"
info_word = "info issue" if counts["INFO"] == 1 else "info issues"
"""

def plural(count, sing, plur=None):
return sing if count == 1 else (plur or sing + "s")
Loading