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

Bug: false positive of "[R] → Space missing after comma" #671

Closed
RichMorin opened this issue Jun 30, 2019 · 6 comments
Closed

Bug: false positive of "[R] → Space missing after comma" #671

RichMorin opened this issue Jun 30, 2019 · 6 comments

Comments

@RichMorin
Copy link

RichMorin commented Jun 30, 2019

Precheck

Done

Environment

  • Credo version (mix credo -v): 1.1.0
  • Erlang/Elixir version (elixir -v): 1.9.0
  • Operating system: macOS High Sierra (version 10.13.6)

What were you trying to do?

$ mix credo

Expected outcome

<crickets>

Actual outcome

[R] → Space missing after comma
  apps/info_files/lib/info_files/cnt_any.ex:193:50
   # (InfoFiles.CntAny.add_file_paths)

Source code

file_patt   = "*.{#{ Enum.join(file_exts, ",") }}"

Discussion

The offending comma is not code; rather, it is located in a text string, which is data. I suspect that credo is getting confused because of the layering of contexts:

  • code
  • data (string "..."))
  • code (interpolated join/2)
  • data (parameter ",")
rrrene added a commit that referenced this issue Jul 16, 2019
@TheFirstAvenger
Copy link
Contributor

I was able to reproduce this issue on v1.1.0 on elixir v1.9.0, but not on v1.1.1. @RichMorin can you verify that it is working as expected for you on a newer version?

@RichMorin
Copy link
Author

Running credo 1.1.5 on elixir 1.9.0, I'm still able to reproduce the issue:

[R] → Space missing after comma
┃ apps/info_files/lib/info_files/cnt_any.ex:162:50 #(InfoFiles.CntAny.add_file_paths)

@TheFirstAvenger
Copy link
Contributor

@RichMorin Still unable to reproduce this on v1.1.5, but I see it on v1.1.0. Can you run mix deps.clean credo and mix deps.get credo and retry?

@RichMorin
Copy link
Author

Hmmm. I guess I didn't do a mix deps.clean credo last time. Anyway, the problem seems to have disappeared in v1.1.5; thanks!

@rrrene
Copy link
Owner

rrrene commented Jan 18, 2020

@RichMorin Glad your issue has been solved. Thx again for reporting! 👍

@rrrene rrrene closed this as completed Jan 18, 2020
@RichMorin
Copy link
Author

RichMorin commented Jan 19, 2020 via email

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

3 participants