Skip to content

An @elixir-lang code-style enforcer that will just FIFY instead of complaining

License

Notifications You must be signed in to change notification settings

smartrent/elixir-styler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hex.pm Hexdocs.pm Github.com

Quokka

Quokka is an Elixir formatter plugin that's combination of mix format and mix credo, except instead of telling you what's wrong, it just rewrites the code for you to fit its style rules.

Quokka is a fork of Styler that checks the credo config to determine which rules to rewrite.

Features

See our Rewrites documentation on hexdocs

Installation

Add :quokka as a dependency to your project's mix.exs:

def deps do
  [
    {:quokka, "~> 0.1", only: [:dev, :test], runtime: false},
  ]
end

Then add Quokka as a plugin to your .formatter.exs file

[
  plugins: [Quokka]
]

And that's it! Now when you run mix format you'll also get the benefits of Quokka's Stylish Stylings.

Speed: Expect the first run to take some time as Quokka rewrites violations of styles and bottlenecks on disk I/O. Subsequent formats formats won't take noticeably more time.

Configuration

Quokka can be configured in your .formatter.exs file

[
  plugins: [Quokka],
  quokka: [
    alias_lifting_exclude: [...],
    reorder_configs: true | false
  ]
]

Quokka has several configuration options:

  • :alias_lifting_exclude, which accepts a list of atoms to not lift. See the Module Directive documentation for more
  • :reorder_configs, which controls whether or not the configs in your config/*.exs files are alphabetized. This is true by default.

WARNING: Quokka can change the behaviour of your program!

In some cases, this can introduce bugs. It goes without saying, but look over your changes before committing to main :)

Some ways Quokka can change your program:

License

Quokka is licensed under the Apache 2.0 license. See the LICENSE file for more details.

About

An @elixir-lang code-style enforcer that will just FIFY instead of complaining

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Elixir 100.0%