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

Check files in bin/ are executable #3659

Closed
agrimm opened this issue Oct 21, 2016 · 1 comment
Closed

Check files in bin/ are executable #3659

agrimm opened this issue Oct 21, 2016 · 1 comment

Comments

@agrimm
Copy link
Contributor

agrimm commented Oct 21, 2016

Running rubocop on files in bin lacking permissions to be executed didn't give an offense that they can't be executed.

$ ls -la bin/
total 40
drwxr-xr-x   7 agrimm  staff  238 20 Sep 15:43 .
drwxr-xr-x  23 agrimm  staff  782 21 Oct 14:37 ..
-rw-r--r--   1 agrimm  staff  129 20 Sep 15:43 bundle
-rw-r--r--   1 agrimm  staff  175 20 Sep 15:43 delayed_job
-rw-r--r--   1 agrimm  staff  220 20 Sep 15:43 rails
-rw-r--r--   1 agrimm  staff  164 20 Sep 15:43 rake
-rw-r--r--   1 agrimm  staff  517 20 Sep 15:43 spring

Should RuboCop have the ability to detect this?

The main issues I can think of why it shouldn't are the following:

  • This may cause problems for people to develop on non-UNIX platforms (Windows).
  • This assumes that there's a known root directory of a project, and a known folder structure.
  • RuboCop may not be able to access information about file permissions of a file.

Expected behavior

Reporting an offense for files which are in bin/ which are not executable.

Actual behavior

New functionality.

Steps to reproduce the problem

Set a file in bin/ to have permissions -rw-r--r--.

RuboCop version

$ rubocop -V
0.44.1 (using Parser 2.3.1.4, running on ruby 2.1.10 x86_64-darwin14.0)
@bbatsov
Copy link
Collaborator

bbatsov commented Oct 26, 2016

Running rubocop on files in bin lacking permissions to be executed didn't give an offense that they can't be executed.

This is definitely outside the scope of RuboCop.

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