Skip to content

Commit

Permalink
nitpicks
Browse files Browse the repository at this point in the history
  • Loading branch information
ProducerMatt committed Jun 25, 2024
1 parent 8942720 commit c703518
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions lib/plugins/why.ex
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ defmodule Plugins.Why do
end

defmodule Debugging do
@moduledoc false
def probably_a_traceback(str) when is_binary(str),
do: String.contains?(str, "We asked")

Expand Down
5 changes: 3 additions & 2 deletions lib/service.ex
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ defmodule Service do
quote do
@behaviour unquote(__MODULE__)

# in order to use the default schema in doc strings, use this attribute, as the function will not be found when the compiler is compiling the docstring.
# in order to use the default schema in doc strings, use this attribute,
# as docstrings are made at compile-time and the function will not be
# ready yet.
# For example:
#
# @moduledoc """
Expand Down Expand Up @@ -115,7 +117,6 @@ defmodule Service do
# Some common functions make more sense being abbreviated here
# Usually rearranging the arguments for better piping

# TODO: move this into service-generic Stampede.Logger
def txt_format(blk, type, :logger),
do: TxtBlock.Md.format(blk, type)

Expand Down
2 changes: 1 addition & 1 deletion lib/stampede.ex
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ defmodule Stampede do
|> List.to_string()
|> String.starts_with?(to_string(module_name) <> ".")
|> if do
MapSet.put(acc, List.to_atom(name))
MapSet.put(acc, List.to_existing_atom(name))
else
acc
end
Expand Down
1 change: 0 additions & 1 deletion lib/stampede/interaction_form.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ defmodule Stampede.InteractionForm do
use TypeCheck.Defstruct

defstruct!(
# TODO: rename to "chosen_plugin"
plugin: _ :: any(),
service: _ :: atom(),
msg: _ :: MsgReceived.t(),
Expand Down
1 change: 1 addition & 0 deletions lib/stampede/scheduler.ex
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
defmodule Stampede.Scheduler do
@moduledoc false
use Quantum, otp_app: :stampede
end
3 changes: 2 additions & 1 deletion lib/stampede/tables.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
defmodule Stampede.Tables do
@compile [:bin_opt_info, :recv_opt_info]
# Manage various Mnesia tables. Generally avoiding keeping business logic here
@moduledoc false
@compile [:bin_opt_info, :recv_opt_info]
require Logger
use TypeCheck
alias Stampede, as: S
Expand Down
4 changes: 3 additions & 1 deletion lib/txt_block.ex
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ defmodule TxtBlock do

def plain_indent_io(str, prefix, bp) when is_binary(prefix) do
IO.iodata_to_binary(str)
# TODO: this is being recompiled every time. figure out how to precompile binary patterns without needing application state
# TODO: this is being recompiled every time. figure out how to
# precompile binary patterns without needing application state
|> String.split(bp || bp_newline(), trim: true)
|> Enum.flat_map(&[prefix, &1, "\n"])
end
Expand All @@ -96,6 +97,7 @@ defmodule TxtBlock do
end

defmodule TxtBlock.Debugging do
@moduledoc false
use TypeCheck

@spec! all_formats_example() :: TxtBlock.t()
Expand Down

0 comments on commit c703518

Please sign in to comment.