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

Use RuboCop config from cocoapods-core .rubocop.yml file #17

Merged
merged 7 commits into from May 2, 2014

Conversation

AliSoftware
Copy link
Contributor

No description provided.

@AliSoftware AliSoftware changed the title User RuboCop config from cocoapods-core .rubocop.yml file Use RuboCop config from cocoapods-core .rubocop.yml file May 2, 2014
@AliSoftware AliSoftware self-assigned this May 2, 2014
@AliSoftware
Copy link
Contributor

I'm taking this one too. Should be good training for applying the conventions.

One question however: how should we handle long lines that simply affect a very long string into a constant, like this one?

      PLUGINS_URL = 'https://raw.githubusercontent.com/CocoaPods/cocoapods.org/master/data/plugins.json'

Should we write something like this instead?

      GITHUB_RAW_BASE_URL = 'https://raw.githubusercontent.com/'
      PLUGINS_URL = GITHUB_RAW_BASE_URL + 'CocoaPods/cocoapods.org' \
          '/master/data/plugins.json'

Are there rules about indentation on this then, when we use a backslash and go on the next line to continue?

@AliSoftware
Copy link
Contributor

TODO:

  • Fix "Line is too long" offenses
  • Fix "Extra empty line" offenses
  • Fix "Method has too many lines" offenses

The .rubocop.yml config file is pretty tough, not allowing methods longer than 10 lines!

Include:
- Rakefile
Exclude:
- lib/cocoapods-core/vendor/**
Copy link
Contributor

Choose a reason for hiding this comment

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

We may have to customize this config a little bit. It could make sense to separate out local vs CP-common rubocop config if it's being adopted on all the projects.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I started to do exactly that in CocoaPods/Core#126 so that we would have a .rubocop-cocoapods.yml file that will be common across CP projects, and having .rubocop.yml for each repo that simply inherit_from it to start with.

LMK what you think about it.

AliSoftware added a commit to CocoaPods/Core that referenced this pull request May 2, 2014
…P-common rules, so that we start using a common .rubocop-cocoapods.yml across all CP repos

See discussion in CocoaPods/cocoapods-plugins#17
@alloy
Copy link
Member

alloy commented May 2, 2014

Very nice!

Be sure to also take https://github.com/CocoaPods/trunk.cocoapods.org/blob/master/.rubocop.yml into account, which is an app where I have been fine-tuning some settings to my taste as well.

@AliSoftware
Copy link
Contributor

@alloy Thx, I will sure take a look at trunk.cocoapods.org!

Feel free to compare it with CocoaPods/Core#126 as well and give some pointers there if you have any, so we can find a common ground for the shared .rubocop-cocoapods.yml config file 😉

@fabiopelosin
Copy link
Member Author

Looks good to me. If somebody comes up with a way to share a common Rubocop configuration for all the CocoaPods repos that would be awesome.

A solution would be to store it somewhere and add a rake task to update from the stored one and modify only that manually. This configuration could have a default inherited configuration specific for each repo similar to the TODO.

@dbgrandi
Copy link
Contributor

dbgrandi commented May 2, 2014

@AliSoftware 👍

I'm liking rubocop.

dbgrandi pushed a commit that referenced this pull request May 2, 2014
Use RuboCop config from cocoapods-core .rubocop.yml file
@dbgrandi dbgrandi merged commit dbf8fa9 into master May 2, 2014
@dbgrandi dbgrandi deleted the rubocop-fixes branch May 2, 2014 14:50
@dbgrandi
Copy link
Contributor

dbgrandi commented May 2, 2014

@AliSoftware I made one small addition (listed you as an author) and pushed this out as the 0.1.1 gem. Thanks for all the work you put into this!

@AliSoftware
Copy link
Contributor

Nice!
(Maybe it would have been more logical to bump to 0.2.0 as we added features and not just fixed bugs ^^)

@dbgrandi
Copy link
Contributor

dbgrandi commented May 3, 2014

D'oh, you are correct.

fabiopelosin added a commit to CocoaPods/Core that referenced this pull request May 19, 2014
* master:
  [travis-ci] Correctly set the LANG environment
  Trying to fix Travis build error with 'invalid byte sequence'
  Fix .travis.yml to add en_US.UTF8 locale
  Fixing Rakefile exception cases
  Fixing Rakefile's bootstrap
  [Specification::DSL] Introduce default_subspecs
  Update docs in DSL for podspec attribute.
  Fix wrong number on an issue reference in the changelog
  [DSL] Don't prepend the spec name to default_subspec
  Changelog and fixing a quote
  [Rubocop] Adding exclusion of `spec/fixtures/**` in the `.rubocop-cocoapods.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/**`)
  [Rubocop] trying to split CocoaPods/Core specific rubocop rules and CP-common rules, so that we start using a common .rubocop-cocoapods.yml across all CP repos See discussion in CocoaPods/cocoapods-plugins#17
  Added missing space to acceptor
  Add labels to all the linter warnings and errors
  [Gemspec] Drop requirement for ActiveSupport < 4
  Simplify URL validation.
  Validate URIs before making requests, only catch SocketErrors.

Conflicts:
	CHANGELOG.md
Ashton-W pushed a commit to Ashton-W/Core that referenced this pull request Nov 2, 2015
…P-common rules, so that we start using a common .rubocop-cocoapods.yml across all CP repos

See discussion in CocoaPods/cocoapods-plugins#17
Ashton-W pushed a commit to Ashton-W/Core that referenced this pull request Nov 2, 2015
* master:
  [travis-ci] Correctly set the LANG environment
  Trying to fix Travis build error with 'invalid byte sequence'
  Fix .travis.yml to add en_US.UTF8 locale
  Fixing Rakefile exception cases
  Fixing Rakefile's bootstrap
  [Specification::DSL] Introduce default_subspecs
  Update docs in DSL for podspec attribute.
  Fix wrong number on an issue reference in the changelog
  [DSL] Don't prepend the spec name to default_subspec
  Changelog and fixing a quote
  [Rubocop] Adding exclusion of `spec/fixtures/**` in the `.rubocop-cocoapods.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/**`)
  [Rubocop] trying to split CocoaPods/Core specific rubocop rules and CP-common rules, so that we start using a common .rubocop-cocoapods.yml across all CP repos See discussion in CocoaPods/cocoapods-plugins#17
  Added missing space to acceptor
  Add labels to all the linter warnings and errors
  [Gemspec] Drop requirement for ActiveSupport < 4
  Simplify URL validation.
  Validate URIs before making requests, only catch SocketErrors.

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

Successfully merging this pull request may close these issues.

None yet

5 participants