rrrene / credo

A static code analysis tool for the Elixir language with a focus on code consistency and teaching.
http://credo-ci.org/
MIT License
4.94k stars 419 forks source link

`There should be no more than 1 consecutive blank lines.` should not trigger for string data #1078

Closed wkirschbaum closed 11 months ago

wkirschbaum commented 1 year ago

Environment

1.7.1-ref.main.3873d0cb+uncommittedchanges

Erlang/OTP 26 [erts-14.1] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit:ns]

Elixir 1.15.6 (compiled with Erlang/OTP 26)

Linux/Arch

What were you trying to do?

The following is valid code and often used when writing tests:

  foo = "
  a

  b
  "

Expected outcome

Credo should not emit a warning, as this is data not code.

Actual outcome

A code readability issue is shows in the report: There should be no more than 1 consecutive blank lines.

rrrene commented 1 year ago

That's right, that's a bug! 👍

rrrene commented 1 year ago

Thx for reporting it 🙂

rrrene commented 11 months ago

Thanks for reporting this 😀 It is now fixed on master.

You can try this by setting the Credo dep to

{:credo, github: "rrrene/credo"}

Please report back if your issue is solved! 👍

wkirschbaum commented 11 months ago

@rrrene thanks! It looks to be solved.