Current section
Files
Jump to
Current section
Files
src/builder@format.erl
-module(builder@format).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/builder/format.gleam").
-export([format_gleam_code/1]).
-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.
-file("src/builder/format.gleam", 6).
?DOC(
" Format Gleam source code using the standard gleam formatter\n"
"\n"
" Runs the code through `gleam format --stdin` and returns the formatted result.\n"
).
-spec format_gleam_code(binary()) -> {ok, binary()} | {error, nil}.
format_gleam_code(Code) ->
builder_format_ffi:format_gleam_code(Code).