Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into tf-consistent-wording
Browse files Browse the repository at this point in the history
  • Loading branch information
novaugust committed May 21, 2024
2 parents d2f1720 + 9179e74 commit 3384345
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/style.ex
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ defmodule Styler.Style do

@doc """
"Fixes" the line numbers of nodes who have had their orders changed via sorting or other methods.
This "fix" siply ensures that comments don't get wrecked as part of us moving AST nodes willy-nilly.
This "fix" simply ensures that comments don't get wrecked as part of us moving AST nodes willy-nilly.
The fix is rather naive, and simply enforces the following property on the code:
A given node must have a line number less than the following node.
Expand Down
4 changes: 2 additions & 2 deletions lib/style/module_directives.ex
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,8 @@ defmodule Styler.Style.ModuleDirectives do

if Enum.any?(liftable) do
# This is a silly hack that helps comments stay put.
# the `cap_line` algo was designed to handle high-line stuff moving up into low line territory, so we set our
# new node to have an abritrarily high line annnnd comments behave! i think.
# The `cap_line` algo was designed to handle high-line stuff moving up into low line territory, so we set our
# new node to have an arbitrarily high line annnnd comments behave! i think.
m = [line: 999_999]

aliases =
Expand Down
2 changes: 1 addition & 1 deletion test/style/pipes_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ defmodule Styler.Style.PipesTest do
end

describe "simple rewrites" do
test "rewrites anonymous function invocation to use then" do
test "rewrites anonymous function invocations to use then" do
assert_style("a |> (& &1).()", "then(a, & &1)")
assert_style("a |> (& {&1, &2}).(b)", "(&{&1, &2}).(a, b)")
assert_style("a |> (& &1).() |> c", "a |> then(& &1) |> c()")
Expand Down

0 comments on commit 3384345

Please sign in to comment.