From a83915d5890fa3f17b1d72b09f05d6f93b1c9732 Mon Sep 17 00:00:00 2001 From: Olivier Halligon Date: Fri, 2 May 2014 08:12:40 +0200 Subject: [PATCH 1/2] [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 --- .rubocop-cocoapods.yml | 59 +++++++++++++++++++++++++++++++++++ .rubocop.yml | 70 +++++------------------------------------- 2 files changed, 66 insertions(+), 63 deletions(-) create mode 100644 .rubocop-cocoapods.yml diff --git a/.rubocop-cocoapods.yml b/.rubocop-cocoapods.yml new file mode 100644 index 000000000..3f8527883 --- /dev/null +++ b/.rubocop-cocoapods.yml @@ -0,0 +1,59 @@ +AllCops: + Include: + - Rakefile + +#- CocoaPods -----------------------------------------------------------------# + +# We adopted raise instead of fail. +SignalException: + EnforcedStyle: only_raise + +# They are idiomatic +AssignmentInCondition: + Enabled: false + +# Allow backticks +AsciiComments: + Enabled: false + +# Indentation clarifies logic branches in implementations +IfUnlessModifier: + Enabled: false + +# No enforced convention here. +SingleLineBlockParams: + Enabled: false + +# We only add the comment when needed. +Encoding: + Enabled: false + +#- CocoaPods support for Ruby 1.8.7 ------------------------------------------# + +HashSyntax: + EnforcedStyle: hash_rockets + +Lambda: + Enabled: false + + +#- CocoaPods specs -----------------------------------------------------------# + +# Allow for `should.match /regexp/`. +AmbiguousRegexpLiteral: + Exclude: + - spec/** + +# Allow `object.should == object` syntax. +Void: + Exclude: + - spec/** + +ClassAndModuleChildren: + Exclude: + - spec/** + +UselessComparison: + Exclude: + - spec/** + diff --git a/.rubocop.yml b/.rubocop.yml index 89535ba86..0cccaf4f3 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,70 +1,14 @@ -AllCops: - Include: - - Rakefile - Exclude: - - lib/cocoapods-core/vendor/** - - spec/fixtures/** - -inherit_from: rubocop-todo.yml - -#- CocoaPods -----------------------------------------------------------------# - -# We adopted raise instead of fail. -SignalException: - EnforcedStyle: only_raise - -# They are idiomatic -AssignmentInCondition: - Enabled: false - -# Allow backticks -AsciiComments: - Enabled: false - -# Indentation clarifies logic branches in implementations -IfUnlessModifier: - Enabled: false - -# No enforced convention here. -SingleLineBlockParams: - Enabled: false - -# We only add the comment when needed. -Encoding: - Enabled: false - -#- CocoaPods support for Ruby 1.8.7 ------------------------------------------# - -HashSyntax: - EnforcedStyle: hash_rockets - -Lambda: - Enabled: false +inherit_from: + - rubocop-todo.yml + - .rubocop-cocoapods.yml +#- Core ----------------------------------------------------------------------- -#- CocoaPods specs -----------------------------------------------------------# - -# Allow for `should.match /regexp/`. -AmbiguousRegexpLiteral: - Exclude: - - spec/** - -# Allow `object.should == object` syntax. -Void: - Exclude: - - spec/** - -ClassAndModuleChildren: +AllCops: Exclude: - - spec/** - -#- Core ----------------------------------------------------------------------- + - spec/fixtures/** + - lib/cocoapods-core/vendor/** FileName: Exclude: - lib/cocoapods-core.rb - -UselessComparison: - Exclude: - - spec/** - From f710d4fd272f8bc71e1f7c29139528bea50d5d22 Mon Sep 17 00:00:00 2001 From: Olivier Halligon Date: Fri, 2 May 2014 08:43:51 +0200 Subject: [PATCH 2/2] [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-cocoapods.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.rubocop-cocoapods.yml b/.rubocop-cocoapods.yml index 3f8527883..ea57d89e1 100644 --- a/.rubocop-cocoapods.yml +++ b/.rubocop-cocoapods.yml @@ -1,6 +1,8 @@ AllCops: Include: - Rakefile + Exclude: + - spec/fixtures/** #- CocoaPods -----------------------------------------------------------------#