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

Somehow let Reek examine ruby files that don't have the .rb extension #721

Open
mvz opened this issue Sep 24, 2015 · 5 comments
Open

Somehow let Reek examine ruby files that don't have the .rb extension #721

mvz opened this issue Sep 24, 2015 · 5 comments

Comments

@mvz
Copy link
Collaborator

mvz commented Sep 24, 2015

Reek currently won't examine your Rakefile or executables (bin/whatever) because they don't have the .rb extension. We should do something smart here.

@troessner
Copy link
Owner

file Rakefile

Rakefile: ASCII text

No way of doing that without shebang.
I see 3 possibilities here:

1.) We expect ruby files to have a shebang and then use file or something similar
2.) We use something like this: https://github.com/minad/mimemagic (which would add a dependency to reek)
3.) We have a whitelist for common files like "Rakefile" and so on

@mvz
Copy link
Collaborator Author

mvz commented Sep 24, 2015

I would say we use at least option 3, and then either 1 or 2. It looks like mimemagic implements at least the shebang method.

I'd also have a look at how Rubocop does this.

@chastell
Copy link
Collaborator

👍 for whitelisting Rakefile and Gemfile – the latter until everybody finally switches to gems.rb ;) – and I’m ok with using mimemagic as well (I’d prefer this over shelling out to file).

@mvz
Copy link
Collaborator Author

mvz commented Sep 25, 2015

the latter until everybody finally switches to gems.rb

This will be a while since even generating a new gem project with bundler will create a Gemfile rather than gems.rb 😿.

@chastell
Copy link
Collaborator

Yes, they can’t change it in Bundler 1.x, but gems.rb will likely be Bundler 2.0’s default: rubygems/bundler#694

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants