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

not including parent level dir #990

Closed
ff-apujari opened this issue Apr 10, 2014 · 5 comments
Closed

not including parent level dir #990

ff-apujari opened this issue Apr 10, 2014 · 5 comments
Assignees

Comments

@ff-apujari
Copy link

AllCops:
  Include:
    - '../other_rails_engine/**'

seems it is not including a dir above even when specified. ../other_rails_engine is a rails app in gem form that we are using commonly across several apps

If I comment this line or not, the count of offenses coming same, nor do I find a file listed in the offenses belonging to the other_rails_engine

@bbatsov
Copy link
Collaborator

bbatsov commented Jun 12, 2014

@jonas054 This is isn't supposed to work, right? Referring a folder outside of the project seems pretty odd to me. Maybe we should issue a warning or something.

@jonas054
Copy link
Collaborator

@ff-apujari I can see why you would expect this to work, but as @bbatsov says this is not how Include works and a warning would be a good idea.

RuboCop searches the directories given to it on the command line (or the current directory by default) for all files. Then it selects what it considers to be ruby files for inspection. The Include and Exclude properties are only used for filtering.

A redesign to support the behavior you wanted seems like a lot of work, and for little gain. There are other ways to inspect multiple projects.

@jonas054 jonas054 self-assigned this Jun 13, 2014
@bbatsov
Copy link
Collaborator

bbatsov commented Jun 13, 2014

@jonas054 Should we issue a warning for such Include/Exclude paths? (or we can simply close the issue)

@jonas054
Copy link
Collaborator

Keep it open. I'll try to implement something.

@jonas054
Copy link
Collaborator

On second thought, I'll close the issue without action. I think it's too difficult to determine which Include patterns are mistakes and which are just unusual but intentional. The description of Include and Exclude in the README are satisfactory IMO.

@ff-apujari The proper way to inspect the other project together with the current one is to run

rubocop . ../other_rails_engine

Note, however, that there should be a .rubocop.yml file under other_rails_engine because the one in the current directory will not be used for the inspection of files under other_rails_engine.

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