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

[Rubocop] Use a .rubocop-cocoapods.yml config file common to all CP repos #126

Merged
merged 2 commits into from May 3, 2014

Conversation

AliSoftware
Copy link
Contributor

As discussed in CocoaPods/cocoapods-plugins#17 (specifically here)

Trying to split the rubocop rules to have rules specific to CocoaPods/Core separated to rules that should be common to all CP repos, like CocoaPods/CocoaPods but also CP plugins.
This way we could have every CP repo inherit_from the same .rubocop-cocoapods.yml and then only throw their specific rules

/c @dbgrandi @irrationalfab

…P-common rules, so that we start using a common .rubocop-cocoapods.yml across all CP repos

See discussion in CocoaPods/cocoapods-plugins#17
- spec/**

#- Core -----------------------------------------------------------------------
- spec/fixtures/**
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately I didn't find a way to move this spec/fixtures/** exclusion to .rubocop-cocoapods.yml because as soon as we give a new value to the AllCops/Exclude/ YAML key the whole key is overriden (meaning that there is no concat between the AllCops/Exclude/ inherited array and the one here, but just a plain replacement).

Open for ideas on this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe adding a pattern like lib/**/vendor/** for the AllCops/Exclude key in .rubocop-cocoapods.yml would work and do what we expect from this exclusion?
So that we could remove this key from the repo-specific .rubocop.yml config file and avoid the problem?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I plan to remove the vendor stuff so I won't bother too much about it.

@AliSoftware
Copy link
Contributor Author

Side note: Maybe we could use this occasion to change the Rakefile integration too, and do as suggested in rubocop's README here instead of using Rubocop::CLI.new?

require 'rubocop/rake_task'
Rubocop::RakeTask.new do |task|
  task.fail_on_error = true
end

…oapods.yml` common rules config file

even if it has to be repeated in the .rubocop.yml config file if we need to add other exclusions (like `lib/*/vendor/**`)
@AliSoftware
Copy link
Contributor Author

Reminder: also take https://github.com/CocoaPods/trunk.cocoapods.org/blob/master/.rubocop.yml into account when we build the .rubocop-cocoapods.yml common file
/c @alloy

@fabiopelosin
Copy link
Member

Side note: Maybe we could use this occasion to change the Rakefile integration too, and do as suggested in rubocop's README here instead of using Rubocop::CLI.new?

👍

@fabiopelosin
Copy link
Member

We should have a place where to store the canonical .rubocop-cocoapods.yml file and add a rake task to update it.

Ace work!

@AliSoftware
Copy link
Contributor Author

We should have a place where to store the canonical .rubocop-cocoapods.yml file and add a rake task to update it.

Great idea. Where should be put it? Having a dedicated repo for this seems overkill, so maybe use the one from CocoaPods/Core here as a reference for all others?
And then make the rake task do some curl https://raw.githubusercontent.com/CocoaPods/Core/master/.rubocop-cocoapods.yml -o .rubocop-cocoapods.yml (for all repos except CocoaPods/Core of course)?

@fabiopelosin
Copy link
Member

Great idea, the reference should be in CocoaPods/CocoaPods imo, and the rake task should be added to Rainforest (as it is common).

@AliSoftware
Copy link
Contributor Author

Ok then I will let you guys do it, as I am not familiar with the Rainforest environment yet and how to do this in a clean way without breaking it all 😉

@fabiopelosin
Copy link
Member

👍

fabiopelosin added a commit that referenced this pull request May 3, 2014
[Rubocop] Use a .rubocop-cocoapods.yml config file common to all CP repos
@fabiopelosin fabiopelosin merged commit 6b63300 into master May 3, 2014
@kylef kylef deleted the rubocop-common branch May 4, 2014 00:08
Ashton-W pushed a commit to Ashton-W/Core that referenced this pull request Nov 2, 2015
[Rubocop] Use a .rubocop-cocoapods.yml config file common to all CP repos
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

Successfully merging this pull request may close these issues.

None yet

2 participants