Skip to content

jeremylightsmith/exacto_knife

Repository files navigation

ExactoKnife

Github Actions Module Version Hex Docs Total Download License Last Updated

Refactoring tools for elixir!

Refactorings

Refactoring: Sort aliases

> mix refactor sort_aliases [FILE]

Sort all aliases in a file:

alias Alpha
alias Alpha.Bravo
alias Alpha.Charlie
alias Delta

Refactoring: Expand aliases

> mix refactor expand_aliases [FILE]

Expand out all aliases in a file:

alias Foo.Bar.Baz
alias Foo.Bar.Boom

Refactoring: Consolidate aliases

> mix refactor consolidate_aliases [FILE]

Sort and combine all aliases in a file:

alias Foo.Bar.{Baz, Boom}

Refactoring: Rename Variable

> mix refactor rename [FILE] [LINE] [COLUMN]

Renames a variable (currently this is a fairly naive implementation - issues welcome!)

More to come...


Running against an entire codebase

Find is your friend

> find lib -type f -name "*.ex*" | xargs -n1 mix refactor sort_aliases

Installation

Exacto Knife can be installed by adding exacto_knife to your list of dependencies in mix.exs:

def deps do
  [
    {:exacto_knife, "~> 0.1.5"}
  ]
end

Docs can be found at https://hexdocs.pm/exacto_knife.


Contributing

  • Clone the repo
  • Write a failing test for your change
  • Make sure all tests pass
  • Submit a PR
  • We all win!!!

Releasing

  • bump the version in mix.exs and README.md
  • commit
  • make sure github ci passes
  • run mix hex.publish

Links

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages