Skip to content
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d8dbcb7
Update run.sh
quintuple-mallard Aug 24, 2025
b32ce00
Update run.sh
quintuple-mallard Aug 24, 2025
1ff07ef
Update analyzer to only analyze .ua files, add tests
quintuple-mallard Aug 25, 2025
e66d900
Add newlines to the ends of expected_tags files
quintuple-mallard Aug 25, 2025
0bfbf5e
Add debug
quintuple-mallard Aug 25, 2025
f2a3fcc
Can't use bash in sh, can I?
quintuple-mallard Aug 25, 2025
7121a2d
Clean up expected
quintuple-mallard Aug 25, 2025
0ee97c2
Update analyzer, this should pass the ci
quintuple-mallard Aug 25, 2025
87f40b9
newlines causing trouble as always
quintuple-mallard Aug 25, 2025
47fdbe3
Remove debug
quintuple-mallard Aug 25, 2025
ed41c90
wow the ci is strict
quintuple-mallard Aug 25, 2025
0c5dacf
Remove jq debug as well
quintuple-mallard Aug 25, 2025
ba98f9b
format
quintuple-mallard Aug 25, 2025
8dc5f1d
Could this finally fix it?
quintuple-mallard Aug 25, 2025
b935643
Revert "Could this finally fix it?"
quintuple-mallard Aug 25, 2025
f6b3750
each isn't yet deprecated in uiua 14
quintuple-mallard Aug 25, 2025
a80e978
Pleasing the CI yet another time
quintuple-mallard Aug 25, 2025
54bb4b0
Yep. CI.
quintuple-mallard Aug 25, 2025
26de842
Make the analyzer add type
quintuple-mallard Aug 30, 2025
669246e
Remove todo
quintuple-mallard Aug 31, 2025
f45265f
Remove rest of TODO as well
quintuple-mallard Aug 31, 2025
81d5860
Update Dockerfile
quintuple-mallard Sep 1, 2025
3cd8a36
Update Dockerfile
quintuple-mallard Sep 1, 2025
cc3fd10
Fix tests
quintuple-mallard Sep 1, 2025
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
32 changes: 29 additions & 3 deletions bin/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
#!/usr/bin/env sh

# Synopsis:
# Run the analyzer on a solution.
Expand All @@ -21,6 +21,32 @@ if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]; then
exit 1
fi

analyze_files() {
TEMP1=$(mktemp)
for file in "$1"/*.ua; do
[ -e "$file" ] || continue
uiua run "$file" >> "$TEMP1"
done

RESULT=$(cat "$TEMP1")

jq -n --arg in "$RESULT" '
{
comments: (
$in
| split("─")
| map(gsub("^\\s+|\\s+$"; ""))
| map(gsub("(?s)\\n\\s+at.+?\\|"; "\n"))
| map(select(test("^(Warning|Advice|Style):")))
| map({
comment: "uiua.general.generic_message",
params: { comment: . }
})
)
}
'
}

slug="$1"
solution_dir=$(realpath "${2%/}")
output_dir=$(realpath "${3%/}")
Expand All @@ -33,10 +59,10 @@ mkdir -p "${output_dir}"
echo "${slug}: analyzing..."

# Analyze the solution
# TODO: replace the below command with your own command(s)
# TODO: replace the below command with your own command(s)
Comment thread
quintuple-mallard marked this conversation as resolved.
Outdated
# to analyze the solution and output the analysis.json and
# tags.json files
echo '{"comments": []}' > "${analysis_file}"
analyze_files $2 > "${analysis_file}"
echo '{"tags": []}' > "${tags_file}"

echo "${slug}: done"
1 change: 1 addition & 0 deletions tests/deprecated/deprecated.ua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Logo ← ☇ 0
10 changes: 10 additions & 0 deletions tests/deprecated/expected_analysis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"comments": [
{
"comment": "uiua.general.generic_message",
"params": {
"comment": "Warning: ☇ rerank is deprecated and will be removed in a future version, use subscripted ♭ deshape or °⊸(⧻△) instead\n Logo ← ☇ 0"
}
}
]
}
1 change: 1 addition & 0 deletions tests/deprecated/expected_tags.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"tags": []}
10 changes: 10 additions & 0 deletions tests/long-line/expected_analysis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"comments": [
{
"comment": "uiua.general.generic_message",
"params": {
"comment": "Advice: Split this into multiple lines (heuristic: 65/53) 😠\n Logo ← ⍜°⍉(⊂⊃(+0.1↧¤ ⊃((<⊙(⌵/ℂ))0.95|⊂⊙0.5⇌˙×)) (×⊃(=∩⌟<0.2 0.7 /+×⟜ⁿ1_2)((<⊙(⌵/ℂ))1))) ˙⊞⊟-⊸¬÷⟜⇡200"
}
}
]
}
1 change: 1 addition & 0 deletions tests/long-line/expected_tags.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"tags": []}
1 change: 1 addition & 0 deletions tests/long-line/long-line.ua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Logo ← ⍜°⍉(⊂⊃(+0.1↧¤ ⊃((<⊙(⌵/ℂ))0.95|⊂⊙0.5⇌˙×)) (×⊃(=∩⌟<0.2 0.7 /+×⟜ⁿ1_2)((<⊙(⌵/ℂ))1))) ˙⊞⊟-⊸¬÷⟜⇡200
4 changes: 3 additions & 1 deletion tests/no-comments/expected_analysis.json
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{"comments": []}
{
"comments": []
}
10 changes: 10 additions & 0 deletions tests/style-issue/expected_analysis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"comments": [
{
"comment": "uiua.general.generic_message",
"params": {
"comment": "Style: Prefer `⟜` over `⊃∘` for clarity\n Image ← ⊞+.÷⊃∘⇡100"
}
}
]
}
1 change: 1 addition & 0 deletions tests/style-issue/expected_tags.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"tags": []}
1 change: 1 addition & 0 deletions tests/style-issue/style-issue.ua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Image ← ⊞+.÷⊃∘⇡100