Skip to content

Instantly share code, notes, and snippets.

@garthk
Last active January 13, 2020 00:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garthk/42b156ae4ea47fbc8ec8d1fc8af69956 to your computer and use it in GitHub Desktop.
Save garthk/42b156ae4ea47fbc8ec8d1fc8af69956 to your computer and use it in GitHub Desktop.
Demonstrates a way to trigger Credo.Code.ParserError

Credo #732

To demonstrate rrrene/credo#732:

docker build -t credo-732 . && docker run --rm -ti credo-732
defmodule Credo732 do
@moduledoc false
def a_method do
~S(")
~S(])
~S([)
end
@doc """
"""
def another_method, do: nil
end
FROM elixir:1.9.4-alpine
ADD . /root
WORKDIR /root
RUN mix do local.hex --force, deps.get
ENTRYPOINT []
CMD ["mix", "credo", "--strict", "credo732.ex"]
defmodule Credo732.MixProject do
use Mix.Project
def project do
[
app: :credo_732,
version: "0.1.0",
elixir: "~> 1.9",
start_permanent: Mix.env() == :prod,
deps: [{:credo, "~> 1.1.2", only: [:dev, :test], runtime: false}],
preferred_cli_env: [credo: :test]
]
end
def application do
[extra_applications: [:logger]]
end
end
%{
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm"},
"credo": {:hex, :credo, "1.1.5", "caec7a3cadd2e58609d7ee25b3931b129e739e070539ad1a0cd7efeeb47014f4", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"},
"jason": {:hex, :jason, "1.1.2", "b03dedea67a99223a2eaf9f1264ce37154564de899fd3d8b9a21b1a6fd64afe7", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm"},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment