Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Credo failure on Elixir 1.9 with 1.1 #672

Closed
jimsynz opened this issue Jun 30, 2019 · 2 comments
Closed

Credo failure on Elixir 1.9 with 1.1 #672

jimsynz opened this issue Jun 30, 2019 · 2 comments

Comments

@jimsynz
Copy link

jimsynz commented Jun 30, 2019

Environment

  • Credo version (mix credo -v): 1.1.0
  • Erlang/Elixir version (elixir -v):
    Erlang/OTP 22 [erts-10.4] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
    Elixir 1.9.0 (compiled with Erlang/OTP 20)
  • Operating system: macOS 10.14.5 and whatever version of Linux Gitlab CI runs containers in.

What were you trying to do?

As part of my CI run I run mix credo --strict to help ensure that potential contributors do not introduce any code quality issues.

Expected outcome

I expected credo to pass.

Actual outcome

Error while running Elixir.Credo.Check.Readability.MaxLineLength on lib/angle/dms.ex

08:57:30.913 [error] Task #PID<0.142.0> started from #PID<0.92.0> terminating
** (FunctionClauseError) no function clause matching in String.slice/3
    (elixir) lib/string.ex:1864: String.slice("defmodule Angle.DMS do\n  import Angle.Utils, only: [string_to_integer: 1, string_to_number: 1]\n  alias Angle.Degree\n\n  @moduledoc \"\"\"\n\n\"\"\"\n\n  @parser ~r/(-?[0-9]+)\n             (?:[\\x{00b0},\\ ]?\\ *)\n             ([0-9]+)\n             (?:[\\x{2032}',\\ ]?\\ *)\n             ([0-9]+(?:\\.[0-9]+)?)\n             [\\x{2033}\"]?/ux\n\n  @doc \"\"\"\n  Initialize an Angle from integer `d` degrees.\n\n  ## Examples\n\n      iex> init(13)\n      #Angle<13°>\n  \"\"\"\n\n\n\n\"\"\"\n  Initialize an Angle from integer `d` degrees, optionally followed by integer\n  `m` minutes.\n\n  ## Examples\n\n      iex> init(13, 30)\n      #Angle<13° 30′>\n  \"\"\"\n\n\n\n\"\"\"\n  Initialize an Angle from integer `d` degrees, followed by integer\n  `m` minutes and `s` seconds.\n\n  ## Examples\n\n      iex> init(13, 30, 45)\n      #Angle<13° 30′ 45″>\n  \"\"\"\n\n\n\n\n", 797, -1)
    lib/credo/code/heredocs.ex:253: Credo.Code.Heredocs.pad_replaced_heredoc/2
    lib/credo/code/heredocs.ex:156: Credo.Code.Heredocs.parse_heredoc/5
    lib/credo/check/readability/max_line_length.ex:52: Credo.Check.Readability.MaxLineLength.run/2
    lib/credo/check/runner.ex:168: Credo.Check.Runner.do_run_check_on_single_source_file/3
    lib/credo/check/runner.ex:161: Credo.Check.Runner.run_check_on_single_source_file/3
    (elixir) lib/enum.ex:1336: Enum."-map/2-lists^map/1-0-"/2
    (elixir) lib/enum.ex:1336: Enum."-map/2-lists^map/1-0-"/2
Function: #Function<9.89825571/0 in Credo.Check.Runner.run/2>
    Args: []
** (EXIT from #PID<0.92.0>) an exception was raised:
    ** (FunctionClauseError) no function clause matching in String.slice/3
        (elixir) lib/string.ex:1864: String.slice("defmodule Angle.DMS do\n  import Angle.Utils, only: [string_to_integer: 1, string_to_number: 1]\n  alias Angle.Degree\n\n  @moduledoc \"\"\"\n\n\"\"\"\n\n  @parser ~r/(-?[0-9]+)\n             (?:[\\x{00b0},\\ ]?\\ *)\n             ([0-9]+)\n             (?:[\\x{2032}',\\ ]?\\ *)\n             ([0-9]+(?:\\.[0-9]+)?)\n             [\\x{2033}\"]?/ux\n\n  @doc \"\"\"\n  Initialize an Angle from integer `d` degrees.\n\n  ## Examples\n\n      iex> init(13)\n      #Angle<13°>\n  \"\"\"\n\n\n\n\"\"\"\n  Initialize an Angle from integer `d` degrees, optionally followed by integer\n  `m` minutes.\n\n  ## Examples\n\n      iex> init(13, 30)\n      #Angle<13° 30′>\n  \"\"\"\n\n\n\n\"\"\"\n  Initialize an Angle from integer `d` degrees, followed by integer\n  `m` minutes and `s` seconds.\n\n  ## Examples\n\n      iex> init(13, 30, 45)\n      #Angle<13° 30′ 45″>\n  \"\"\"\n\n\n\n\n", 797, -1)
        lib/credo/code/heredocs.ex:253: Credo.Code.Heredocs.pad_replaced_heredoc/2
        lib/credo/code/heredocs.ex:156: Credo.Code.Heredocs.parse_heredoc/5
        lib/credo/check/readability/max_line_length.ex:52: Credo.Check.Readability.MaxLineLength.run/2
        lib/credo/check/runner.ex:168: Credo.Check.Runner.do_run_check_on_single_source_file/3
        lib/credo/check/runner.ex:161: Credo.Check.Runner.run_check_on_single_source_file/3
        (elixir) lib/enum.ex:1336: Enum."-map/2-lists^map/1-0-"/2
        (elixir) lib/enum.ex:1336: Enum."-map/2-lists^map/1-0-"/2

Failure is available at this commit and CI output is available here

@skovmand
Copy link

skovmand commented Jul 2, 2019

This is a duplicate of #665

@jimsynz
Copy link
Author

jimsynz commented Jul 2, 2019

Cool. Closing in favour of that then. Thanks.

@jimsynz jimsynz closed this as completed Jul 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants