From f055ea861224b94e854209359bcf882062e70e19 Mon Sep 17 00:00:00 2001 From: Antoine Bolvy Date: Wed, 24 Jan 2024 10:52:38 +0100 Subject: [PATCH] docs: add configurable section to README --- README.md | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fb99ed20..4e146bf6 100644 --- a/README.md +++ b/README.md @@ -29,9 +29,30 @@ And that's it! Now when you run `mix format` you'll also get the benefits of Sty ### Configuration -There isn't any! This is intentional. +Contrary to Adobe's original Styler, this fork is a bit more configurable, essentially to allow gradual adoption of the tool. -Styler is @adobe's internal Style Guide Enforcer - allowing exceptions to the styles goes against that ethos. Happily, it's open source and thus yours to do with as you will =) +The config is done in the `.formatter.exs` file: + +``` +[ + plugins: [Styler], + styler: [ + # List of rules to enable + + # Can have a keyword list of options + {Styler.Style.ModuleDirectives, []}, + + # Or just a module name + Styler.Style.Pipes + ] +] +``` + +By default, if the `styler` key is not present, all rules are enabled. + +#### Supported options + +* `ignore_prefixes` - a list of file prefixes to skip when applying the rule. Example: `ignore_prefixes: ["test/"]` ## Features (or as we call them, "Styles")