Skip to content
Merged
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
2 changes: 1 addition & 1 deletion build.roc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
app [main!] {
cli: platform "https://github.com/roc-lang/basic-cli/releases/download/0.19.0/Hj-J_zxz7V9YurCSTFcFdu6cQJie4guzsPMUi5kBYUk.tar.br",
cli: platform "https://github.com/roc-lang/basic-cli/releases/download/0.20.0/X73hGh05nNTkDHU06FHC0YfFaQB1pimX7gncRcao5mU.tar.br",
weaver: "https://github.com/smores56/weaver/releases/download/0.6.0/4GmRnyE7EFjzv6dDpebJoWWwXV285OMt4ntHIc6qvmY.tar.br",
}

Expand Down
12 changes: 6 additions & 6 deletions ci/check_all_exposed_funs_tested.roc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
app [main!] { cli: platform "https://github.com/roc-lang/basic-cli/releases/download/0.19.0/Hj-J_zxz7V9YurCSTFcFdu6cQJie4guzsPMUi5kBYUk.tar.br" }
app [main!] { cli: platform "https://github.com/roc-lang/basic-cli/releases/download/0.20.0/X73hGh05nNTkDHU06FHC0YfFaQB1pimX7gncRcao5mU.tar.br" }

import cli.Stdout
import cli.Arg exposing [Arg]
Expand All @@ -20,7 +20,7 @@ err_s = |err_msg| Err(StrErr(err_msg))
main! : List Arg => Result {} _
main! = |_args|
# Check if ripgrep is installed
_ = Cmd.exec!("rg", ["--version"]) ? |err| RipgrepNotInstalled(err)
_ = Cmd.exec!("rg", ["--version"])?

cwd = Env.cwd!({}) ? |err| FailedToGetCwd(err)
Stdout.line!("Current working directory: ${Path.display(cwd)}")?
Expand Down Expand Up @@ -124,12 +124,12 @@ is_function_unused! = |module_name, function_name|
|> Cmd.arg(function_pattern)
|> Cmd.arg(search_dir)

status_res = Cmd.status!(cmd)
ripgrep_res = Cmd.exec_cmd!(cmd)

# ripgrep returns status 0 if matches were found, 1 if no matches
when status_res is
Ok(0) -> Ok(Bool.false) # Function is used (not unused)
_ -> Ok(Bool.true)
when ripgrep_res is
Ok(_) -> Ok(Bool.false) # Function is used (not unused)
Err(_) -> Ok(Bool.true)
)?

unused_in_dir
Expand Down