Skip to content

Commit

Permalink
docs(improve moduledocs): improve moduledocs
Browse files Browse the repository at this point in the history
  • Loading branch information
ckoch-cars committed Jul 20, 2022
1 parent 04d16d9 commit cea9bca
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Use at your peril, _for now._
## Roadmap TODO

- [] Add and configure CHANGELOG tracking.
- [] Add test for one file containing more than one `defmodule`
- [] How does this work with macro code? Does that even make sense as a case to handle?
- [] Update .exs files too?
- [] update test file refs by CLI option
Expand Down
3 changes: 2 additions & 1 deletion lib/ex_factor/changer.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
defmodule ExFactor.Changer do
@moduledoc """
Documentation for `ExFactor.Changer`.
`ExFactor.Changer` find all references to the old (source) Mod.function/arity and update
the calls to use the new (target) Mod.function/arity.
"""

alias ExFactor.Callers
Expand Down
4 changes: 3 additions & 1 deletion lib/ex_factor/extractor.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
defmodule ExFactor.Extractor do
@moduledoc """
Documentation for `ExFactor.Extractor`.
`ExFactor.Extractor` finds the targetd function and places it in a different module.
Create the new (target) module path and file if necessary.
"""
alias ExFactor.Neighbors
alias ExFactor.Parser
Expand Down
3 changes: 1 addition & 2 deletions lib/ex_factor/formatter.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
defmodule ExFactor.Formatter do
@moduledoc """
Documentation for `ExFactor.Formatter`.
Format a list of files
`ExFactor.Formatter` Format a list of files
"""

def format([nil]), do: nil
Expand Down
10 changes: 6 additions & 4 deletions lib/ex_factor/parser.ex
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
defmodule ExFactor.Parser do
@moduledoc """
Documentation for `ExFactor.Parser`.
`ExFactor.Parser` we're making some assumptions that you're using this library within the
context of a Mix app and that every file contains one or more `defmodule` blocks.
"""

# @doc """
# Identify public and private functions from a module AST.
# """
@doc """
Parse the contents of a filepath in an Abstract Syntaxt Tree (AST) and
extraxct the block contents of the module at the filepath.
"""
def read_file(filepath) when is_binary(filepath) do
contents = File.read!(filepath)
list = String.split(contents, "\n")
Expand Down
4 changes: 3 additions & 1 deletion lib/ex_factor/remover.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
defmodule ExFactor.Remover do
@moduledoc """
Documentation for `ExFactor.Remover`.
`ExFactor.Remover` Remove the indicated function and its spec from it's original file.
It's safer to add rather than remove multiple attributes.
"""
alias ExFactor.Parser

Expand Down

0 comments on commit cea9bca

Please sign in to comment.