Skip to content

Commit

Permalink
Fix space around operators check
Browse files Browse the repository at this point in the history
  • Loading branch information
rrrene committed Apr 5, 2021
1 parent 4cceec0 commit bd56b12
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Expand Up @@ -17,6 +17,7 @@ defmodule Credo.Check.Consistency.SpaceAroundOperators.SpaceHelper do
def usually_no_space_before?({:flt, _, _}, {_, _, :-}, _), do: false
def usually_no_space_before?(_, {_, _, :-}, _), do: true
def usually_no_space_before?(_, {_, _, :..}, _), do: true
def usually_no_space_before?(_, {_, _, :"//"}, _), do: true
def usually_no_space_before?(_, _, _), do: false

@doc """
Expand All @@ -40,6 +41,7 @@ defmodule Credo.Check.Consistency.SpaceAroundOperators.SpaceHelper do
def usually_no_space_after?({_, _, :..}, {_, _, :-}, _), do: true
def usually_no_space_after?(_, {_, _, :-}, _), do: false
def usually_no_space_after?(_, {_, _, :..}, _), do: true
def usually_no_space_after?(_, {_, _, :"//"}, _), do: true
def usually_no_space_after?(_, _, _), do: false

def operator?({:comp_op, _, _}), do: true
Expand Down
4 changes: 0 additions & 4 deletions lib/credo/code/interpolation_helper.ex
Expand Up @@ -185,10 +185,6 @@ defmodule Credo.Code.InterpolationHelper do
) do
{line_no, col_start, line_no_end, col_end} = Token.position(token)

{line_no, col_start, line_no_end, col_end}

# |> IO.inspect()

col_end =
if line_no_end > line_no && col_end == 1 do
# This means we encountered :eol and jumped in the next line.
Expand Down

0 comments on commit bd56b12

Please sign in to comment.