Skip to content

Commit 81bb7ef

Browse files
committed
more readme tweakin
1 parent dcfaa74 commit 81bb7ef

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

README.md

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
# Styler
66

7-
Styler is an Elixir formatter plugin that's a combination of `mix format` and `mix credo`, but instead of _telling_
8-
you what's wrong, it just fixes the code for you to fit its style rules.
7+
Styler is an Elixir formatter plugin that goes beyond formatting by rewriting your code for consistency, readability, and optimization.
98

109
## Features
1110

@@ -86,11 +85,13 @@ However, Smartrent has a fork of Styler named [Quokka](https://github.com/smartr
8685

8786
Ultimately Styler is @adobe's internal tool that we're happy to share with the world. We're delighted if you like it as is, and just as excited if it's a starting point for you to make something even better for yourself.
8887

89-
## WARNING: Styler can change the behaviour of your program!
88+
## WARNING: Styler can change the behaviour of your program
9089

91-
In some cases, this can introduce bugs. It goes without saying, but look over your changes before committing to main :)
90+
While Styler endeavors to never purposefully create bugs, some of its rewrites can introduce them in obscure cases.
9291

93-
A simple example of a way Styler changes the behaviour of code is the following rewrite:
92+
It goes without saying, but look over any changes Styler writes before committing to main.
93+
94+
A simple example of a way Styler rewrite can introduce a bug is the following case statement:
9495

9596
```elixir
9697
# Before: this case statement...
@@ -109,19 +110,9 @@ end
109110

110111
These programs are not semantically equivalent. The former would raise if `foo` returned any value other than `true` or `false`, while the latter blissfully completes.
111112

112-
However, Styler is about _style_, and the `if` statement is (in our opinion) of much better style. If the exception behaviour was intentional on the code author's part, they should have written the program like this:
113-
114-
```elixir
115-
case foo do
116-
true -> :ok
117-
false -> :error
118-
other -> raise "expected `true` or `false`, got: #{inspect other}"
119-
end
120-
```
121-
122-
Also good style! But Styler assumes that most of the time people just meant the `if` equivalent of the code, and so makes that change. If issues like this bother you, Styler probably isn't the tool you're looking for.
113+
If issues like this bother you, Styler probably isn't the tool you're looking for.
123114

124-
Other ways Styler can change your program:
115+
Other ways Styler _could_ introduce runtime bugs:
125116

126117
- [`with` statement rewrites](https://github.com/adobe/elixir-styler/issues/186)
127118
- [config file sorting](https://hexdocs.pm/styler/mix_configs.html#this-can-break-your-program)

0 commit comments

Comments
 (0)