Skip to content

Instantly share code, notes, and snippets.

@ZeroPivot
Forked from dsandstrom/.rubocop.yml
Last active September 30, 2021 17:53
Show Gist options
  • Save ZeroPivot/93b4e254b97ec7b9e683a695baec7e51 to your computer and use it in GitHub Desktop.
Save ZeroPivot/93b4e254b97ec7b9e683a695baec7e51 to your computer and use it in GitHub Desktop.

Revisions

  1. ZeroPivot revised this gist Sep 30, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion .rubocop.yml
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    AllCops:
    TargetRubyVersion: 3.0
    NewCops: enable
    SuggestExtensions: false
    SuggestExtensions: true

    Include:
    - 'config.ru'
  2. @dsandstrom dsandstrom revised this gist Jul 4, 2021. No changes.
  3. @dsandstrom dsandstrom revised this gist Jul 4, 2021. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions .rubocop.yml
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,6 @@
    # .rubocop.yml

    # rubocop config files for Ruby 3.0 / Rails 6+ project
    # blog post: http://joanswork.com/rubocop-rails-getting-started/
    # link broken, all I can find: https://github.com/jehughes

    AllCops:
    TargetRubyVersion: 3.0
  4. @dsandstrom dsandstrom revised this gist Jul 4, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion .rubocop.yml
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # .rubocop.yml

    # rubocop config files for Ruby 2.7 / Rails 6+ project
    # rubocop config files for Ruby 3.0 / Rails 6+ project
    # blog post: http://joanswork.com/rubocop-rails-getting-started/
    # link broken, all I can find: https://github.com/jehughes

  5. @dsandstrom dsandstrom revised this gist Jul 4, 2021. 1 changed file with 11 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion .rubocop.yml
    Original file line number Diff line number Diff line change
    @@ -5,8 +5,9 @@
    # link broken, all I can find: https://github.com/jehughes

    AllCops:
    TargetRubyVersion: 2.7
    TargetRubyVersion: 3.0
    NewCops: enable
    SuggestExtensions: false

    Include:
    - 'config.ru'
    @@ -41,6 +42,15 @@ Layout/LineLength:
    Metrics/BlockLength:
    Exclude:
    - 'Guardfile'
    - 'config/environments/*'

    Metrics/ClassLength:
    Exclude:
    - 'db/seeds.rb'
    Max: 150

    Metrics/ModuleLength:
    Max: 150

    Naming/FileName:
    Exclude:
  6. @dsandstrom dsandstrom revised this gist Dec 12, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion spec__fabricators__.rubocop.yml
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    #/spec/fabricators/.rubocop.yml
    # spec/fabricators/.rubocop.yml

    inherit_from:
    - ../../.rubocop.yml
  7. @dsandstrom dsandstrom revised this gist Dec 12, 2020. 3 changed files with 3 additions and 3 deletions.
    2 changes: 1 addition & 1 deletion spec__.rubocop.yml
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # ./spec/.rubocop.yml
    # spec/.rubocop.yml

    inherit_from:
    - ../.rubocop.yml
    2 changes: 1 addition & 1 deletion spec__fabricators__.rubocop.yml
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # ./spec/fabricators/.rubocop.yml
    #/spec/fabricators/.rubocop.yml

    inherit_from:
    - ../../.rubocop.yml
    2 changes: 1 addition & 1 deletion spec__support__.rubocop.yml
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # ./spec/support/.rubocop.yml
    # spec/support/.rubocop.yml

    inherit_from:
    - ../../.rubocop.yml
  8. @dsandstrom dsandstrom revised this gist Oct 31, 2020. 1 changed file with 0 additions and 3 deletions.
    3 changes: 0 additions & 3 deletions .rubocop.yml
    Original file line number Diff line number Diff line change
    @@ -51,9 +51,6 @@ Naming/FileName:
    Style/Documentation:
    Enabled: false

    Style/EmptyMethod:
    Enabled: false

    Style/StringLiterals:
    Enabled: true
    EnforcedStyle: single_quotes
  9. @dsandstrom dsandstrom revised this gist Oct 28, 2020. 5 changed files with 72 additions and 60 deletions.
    59 changes: 59 additions & 0 deletions .rubocop.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,59 @@
    # .rubocop.yml

    # rubocop config files for Ruby 2.7 / Rails 6+ project
    # blog post: http://joanswork.com/rubocop-rails-getting-started/
    # link broken, all I can find: https://github.com/jehughes

    AllCops:
    TargetRubyVersion: 2.7
    NewCops: enable

    Include:
    - 'config.ru'
    - 'Gemfile'
    - 'Guardfile'
    - 'Rakefile'
    - 'app/**/*.rb'
    - 'config/**/*.rb'
    - 'lib/**/*.rb'
    - 'spec/**/*.rb'
    - 'db/seeds.rb'

    Exclude:
    - 'bin/*'
    - 'db/schema.rb'
    - 'db/migrate/*'
    - 'log/**/*'
    - 'node_modules/**/*'
    - 'public/**/*'
    - 'script/**/*'
    - 'vendor/**/*'
    - 'tmp/**/*'
    - '.git/**/*'
    - 'app/views/**/*'

    Layout/IndentationConsistency:
    EnforcedStyle: 'indented_internal_methods'

    Layout/LineLength:
    Max: 80

    Metrics/BlockLength:
    Exclude:
    - 'Guardfile'

    Naming/FileName:
    Exclude:
    - 'Gemfile'
    - 'Guardfile'
    - 'Rakefile'

    Style/Documentation:
    Enabled: false

    Style/EmptyMethod:
    Enabled: false

    Style/StringLiterals:
    Enabled: true
    EnforcedStyle: single_quotes
    58 changes: 0 additions & 58 deletions .rubocop.yml files
    Original file line number Diff line number Diff line change
    @@ -1,58 +0,0 @@
    ##
    # .rubocop.yml

    AllCops:
    TargetRubyVersion: 2.5
    Include:
    - 'config.ru'
    - 'Gemfile'
    - 'Guardfile'
    - 'Rakefile'

    Exclude:
    - 'app/views/**/*'
    - 'bin/*'
    - 'db/schema.rb'
    - 'db/migrate/*'
    - 'log/**/*'
    - 'node_modules/**/*'
    - 'public/**/*'
    - 'scripts/**/*'
    - 'vendor/**/*'
    - 'tmp/**/*'
    - '.git/**/*'

    Documentation:
    Enabled: false

    IndentationConsistency:
    EnforcedStyle: 'rails'

    Metrics/BlockLength:
    Exclude:
    - 'Guardfile'

    Naming/FileName:
    Exclude:
    - 'Gemfile'
    - 'Guardfile'
    - 'Rakefile'

    Rails:
    Enabled: true


    ##
    # ./spec/.rubocop.yml

    inherit_from:
    - ../.rubocop.yml

    StringLiterals:
    EnforcedStyle: double_quotes
    Exclude:
    - './*_helper.rb'

    # describe block
    Metrics/BlockLength:
    Enabled: false
    13 changes: 13 additions & 0 deletions spec__.rubocop.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    # ./spec/.rubocop.yml

    inherit_from:
    - ../.rubocop.yml

    StringLiterals:
    EnforcedStyle: double_quotes
    Exclude:
    - './*_helper.rb'

    # describe block
    Metrics/BlockLength:
    Enabled: false
    1 change: 0 additions & 1 deletion spec__fabricators__.rubocop.yml
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,3 @@
    ##
    # ./spec/fabricators/.rubocop.yml

    inherit_from:
    1 change: 0 additions & 1 deletion spec__support__.rubocop.yml
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,3 @@
    ##
    # ./spec/support/.rubocop.yml

    inherit_from:
  10. @dsandstrom dsandstrom revised this gist Oct 28, 2020. 3 changed files with 10 additions and 16 deletions.
    16 changes: 0 additions & 16 deletions .rubocop.yml files
    Original file line number Diff line number Diff line change
    @@ -56,19 +56,3 @@ StringLiterals:
    # describe block
    Metrics/BlockLength:
    Enabled: false


    ##
    # ./spec/fabricators/.rubocop.yml

    inherit_from:
    - ../../.rubocop.yml


    ##
    # ./spec/support/.rubocop.yml

    inherit_from:
    - ../../.rubocop.yml


    5 changes: 5 additions & 0 deletions spec__fabricators__.rubocop.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    ##
    # ./spec/fabricators/.rubocop.yml

    inherit_from:
    - ../../.rubocop.yml
    5 changes: 5 additions & 0 deletions spec__support__.rubocop.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    ##
    # ./spec/support/.rubocop.yml

    inherit_from:
    - ../../.rubocop.yml
  11. @dsandstrom dsandstrom revised this gist Feb 5, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion .rubocop.yml files
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,7 @@ AllCops:
    - 'log/**/*'
    - 'node_modules/**/*'
    - 'public/**/*'
    - 'script/**/*'
    - 'scripts/**/*'
    - 'vendor/**/*'
    - 'tmp/**/*'
    - '.git/**/*'
  12. @dsandstrom dsandstrom revised this gist Feb 2, 2018. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions .rubocop.yml files
    Original file line number Diff line number Diff line change
    @@ -59,14 +59,16 @@ Metrics/BlockLength:


    ##
    # ./spec/support/.rubocop.yml
    # ./spec/fabricators/.rubocop.yml

    inherit_from:
    - ../../.rubocop.yml


    ##
    # ./spec/fabricators/.rubocop.yml
    # ./spec/support/.rubocop.yml

    inherit_from:
    - ../../.rubocop.yml


  13. @dsandstrom dsandstrom revised this gist Feb 2, 2018. 1 changed file with 10 additions and 6 deletions.
    16 changes: 10 additions & 6 deletions .rubocop.yml files
    Original file line number Diff line number Diff line change
    @@ -42,7 +42,7 @@ Rails:
    Enabled: true


    #
    ##
    # ./spec/.rubocop.yml

    inherit_from:
    @@ -51,18 +51,22 @@ inherit_from:
    StringLiterals:
    EnforcedStyle: double_quotes
    Exclude:
    - './rails_helper.rb'
    - './spec_helper.rb'
    - './*_helper.rb'

    # describe block
    Metrics/BlockLength:
    Enabled: false

    Rails/SkipsModelValidations:
    Enabled: false


    ##
    # ./spec/support/.rubocop.yml

    inherit_from:
    - ../../.rubocop.yml

    ##
    # ./spec/fabricators/.rubocop.yml

    inherit_from:
    - ../../.rubocop.yml

  14. @dsandstrom dsandstrom revised this gist Feb 2, 2018. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions .rubocop.yml files
    Original file line number Diff line number Diff line change
    @@ -22,22 +22,22 @@ AllCops:
    - 'tmp/**/*'
    - '.git/**/*'

    Documentation:
    Enabled: false

    IndentationConsistency:
    EnforcedStyle: 'rails'

    Documentation:
    Enabled: false
    Metrics/BlockLength:
    Exclude:
    - 'Guardfile'

    Naming/FileName:
    Exclude:
    - 'Gemfile'
    - 'Guardfile'
    - 'Rakefile'

    Metrics/BlockLength:
    Exclude:
    - 'Guardfile'

    Rails:
    Enabled: true

  15. @dsandstrom dsandstrom revised this gist Feb 2, 2018. 1 changed file with 17 additions and 23 deletions.
    40 changes: 17 additions & 23 deletions .rubocop.yml files
    Original file line number Diff line number Diff line change
    @@ -2,26 +2,25 @@
    # .rubocop.yml

    AllCops:
    TargetRubyVersion: 2.4
    TargetRubyVersion: 2.5
    Include:
    - '**/Rakefile'
    - '**/config.ru'
    - 'config.ru'
    - 'Gemfile'
    - 'Guardfile'
    - 'Rakefile'

    Exclude:
    - 'app/views/**/*'
    - 'bin/*'
    - 'db/schema.rb'
    - 'db/migrate/*'
    - 'config/**/*'
    - 'log/**/*'
    - 'node_modules/**/*'
    - 'public/**/*'
    - 'script/**/*'
    - 'app/views/**/*'
    - 'vendor/**/*'
    - 'bin/*'
    - 'app/helpers/public_helper.rb'
    - '.git/**/*'
    - 'tmp/**/*'
    - 'public/**/*'
    - 'log/**/*'

    Rails:
    Enabled: true
    - '.git/**/*'

    IndentationConsistency:
    EnforcedStyle: 'rails'
    @@ -33,19 +32,14 @@ Naming/FileName:
    Exclude:
    - 'Gemfile'
    - 'Guardfile'
    - 'Capfile'

    Style/ClassAndModuleChildren:
    Enabled: false

    Metrics/ClassLength:
    Max: 150
    - 'Rakefile'

    Metrics/BlockLength:
    Max: 50
    Exclude:
    - 'Guardfile'

    Naming/VariableNumber:
    EnforcedStyle: 'snake_case'
    Rails:
    Enabled: true


    #
  16. @dsandstrom dsandstrom revised this gist Jan 31, 2018. 1 changed file with 42 additions and 49 deletions.
    91 changes: 42 additions & 49 deletions .rubocop.yml files
    Original file line number Diff line number Diff line change
    @@ -1,81 +1,74 @@
    # rubocop config files for small Rails4/Ruby2 project
    # blog post: http://joanswork.com/rubocop-rails-getting-started/

    ##
    # .rubocop.yml

    AllCops:
    TargetRubyVersion: 2.4
    Include:
    - Rakefile
    - config.ru
    - '**/Rakefile'
    - '**/config.ru'
    Exclude:
    - 'db/schema.rb'
    - 'db/**/*'
    - 'db/migrate/*'
    - 'config/**/*'
    - 'script/**/*'
    - 'app/views/**/*.html.erb'
    - !ruby/regexp /old_and_unused\.rb$/

    - 'app/views/**/*'
    - 'vendor/**/*'
    - 'bin/*'
    - 'app/helpers/public_helper.rb'
    - '.git/**/*'
    - 'tmp/**/*'
    - 'public/**/*'
    - 'log/**/*'

    Rails:
    Enabled: true

    IndentationConsistency:
    EnforcedStyle: 'rails'

    Documentation:
    Enabled: false

    # SpaceInsideHashLiteralBraces:
    # EnforcedStyle: no_space

    # MethodLength:
    # Max: 20 # revisit

    HasAndBelongsToMany: # being used for a reason
    Documentation:
    Enabled: false

    Naming/FileName:
    Exclude:
    - 'Gemfile'
    - 'Guardfile'
    - 'Capfile'


    # ./db/migrate/.rubocop.yml

    inherit_from:
    - ../../.rubocop.yml

    MethodLength:
    Max: 200

    SingleSpaceBeforeFirstArg:
    Style/ClassAndModuleChildren:
    Enabled: false


    Metrics/ClassLength:
    Max: 150

    # ./app/controllers/local_devise/.rubocop.yml
    Metrics/BlockLength:
    Max: 50

    inherit_from:
    - ../../../.rubocop.yml

    ClassAndModuleChildren:
    Enabled: false

    AccessorMethodName:
    Enabled: false

    Naming/VariableNumber:
    EnforcedStyle: 'snake_case'


    #
    # ./spec/.rubocop.yml

    inherit_from:
    - ../.rubocop.yml

    Blocks:
    Enabled: false

    StringLiterals:
    EnforcedStyle: double_quotes


    Exclude:
    - './rails_helper.rb'
    - './spec_helper.rb'

    # ./spec/factories/.rubocop.yml
    Metrics/BlockLength:
    Enabled: false

    Rails/SkipsModelValidations:
    Enabled: false


    ##
    # ./spec/support/.rubocop.yml
    inherit_from:
    - ../../.rubocop.yml

    StringLiterals:
    EnforcedStyle: single_quotes

  17. @dsandstrom dsandstrom revised this gist Nov 17, 2015. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion .rubocop.yml files
    Original file line number Diff line number Diff line change
    @@ -78,5 +78,4 @@ inherit_from:

    StringLiterals:
    EnforcedStyle: single_quotes


  18. @dsandstrom dsandstrom revised this gist Nov 17, 2015. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions .rubocop.yml files
    Original file line number Diff line number Diff line change
    @@ -74,8 +74,9 @@ StringLiterals:
    # ./spec/factories/.rubocop.yml

    inherit_from:
    - ../.rubocop.yml
    - ../../.rubocop.yml

    StringLiterals:
    EnforcedStyle: single_quotes

    LineLength:
    Max: 2048

  19. @dsandstrom dsandstrom revised this gist Nov 16, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions .rubocop.yml files
    Original file line number Diff line number Diff line change
    @@ -18,8 +18,8 @@ AllCops:
    IndentationConsistency:
    EnforcedStyle: 'rails'

    # Documentation:
    # Enabled: false
    Documentation:
    Enabled: false

    # SpaceInsideHashLiteralBraces:
    # EnforcedStyle: no_space
  20. @dsandstrom dsandstrom revised this gist Nov 16, 2015. 1 changed file with 16 additions and 11 deletions.
    27 changes: 16 additions & 11 deletions .rubocop.yml files
    Original file line number Diff line number Diff line change
    @@ -8,23 +8,28 @@ AllCops:
    - Rakefile
    - config.ru
    Exclude:
    - db/schema.rb
    - 'db/schema.rb'
    - 'db/**/*'
    - 'config/**/*'
    - 'script/**/*'
    - 'app/views/**/*.html.erb'
    - !ruby/regexp /old_and_unused\.rb$/

    SpaceInsideHashLiteralBraces:
    EnforcedStyle: no_space
    IndentationConsistency:
    EnforcedStyle: 'rails'

    # Documentation:
    # Enabled: false

    MethodLength:
    Max: 20 # revisit
    # SpaceInsideHashLiteralBraces:
    # EnforcedStyle: no_space

    # MethodLength:
    # Max: 20 # revisit

    HasAndBelongsToMany: # being used for a reason
    Enabled: false

    EmptyLinesAroundBody: # prefer empty line for legibility
    Enabled: false

    Documentation: # later - part of bigger project
    Enabled: false



    # ./db/migrate/.rubocop.yml
  21. @dsandstrom dsandstrom revised this gist Nov 16, 2015. 1 changed file with 1 addition and 4 deletions.
    5 changes: 1 addition & 4 deletions .rubocop.yml files
    Original file line number Diff line number Diff line change
    @@ -9,9 +9,6 @@ AllCops:
    - config.ru
    Exclude:
    - db/schema.rb

    LineLength:
    Max: 179 # revisit

    SpaceInsideHashLiteralBraces:
    EnforcedStyle: no_space
    @@ -65,7 +62,7 @@ Blocks:
    Enabled: false

    StringLiterals:
    Enabled: false
    EnforcedStyle: double_quotes



  22. @jehughes jehughes revised this gist Apr 28, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion .rubocop.yml files
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    # rubocop config files for small Rails4/Ruby2 project
    # blog post: http://joanswork.com/
    # blog post: http://joanswork.com/rubocop-rails-getting-started/

    # .rubocop.yml

  23. @jehughes jehughes revised this gist Apr 28, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions .rubocop.yml files
    Original file line number Diff line number Diff line change
    @@ -11,13 +11,13 @@ AllCops:
    - db/schema.rb

    LineLength:
    Max: 179 # reduce over time
    Max: 179 # revisit

    SpaceInsideHashLiteralBraces:
    EnforcedStyle: no_space

    MethodLength:
    Max: 20 # reduce over time
    Max: 20 # revisit

    HasAndBelongsToMany: # being used for a reason
    Enabled: false
  24. @jehughes jehughes revised this gist Apr 28, 2014. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions .rubocop.yml files
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,6 @@
    # rubocop config files for small Rails4/Ruby2 project
    # blog post: http://joanswork.com/

    # .rubocop.yml

    AllCops:
  25. @jehughes jehughes renamed this gist Apr 28, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  26. @jehughes jehughes created this gist Apr 28, 2014.
    76 changes: 76 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,76 @@
    # .rubocop.yml

    AllCops:
    Include:
    - Rakefile
    - config.ru
    Exclude:
    - db/schema.rb

    LineLength:
    Max: 179 # reduce over time

    SpaceInsideHashLiteralBraces:
    EnforcedStyle: no_space

    MethodLength:
    Max: 20 # reduce over time

    HasAndBelongsToMany: # being used for a reason
    Enabled: false

    EmptyLinesAroundBody: # prefer empty line for legibility
    Enabled: false

    Documentation: # later - part of bigger project
    Enabled: false



    # ./db/migrate/.rubocop.yml

    inherit_from:
    - ../../.rubocop.yml

    MethodLength:
    Max: 200

    SingleSpaceBeforeFirstArg:
    Enabled: false



    # ./app/controllers/local_devise/.rubocop.yml

    inherit_from:
    - ../../../.rubocop.yml

    ClassAndModuleChildren:
    Enabled: false

    AccessorMethodName:
    Enabled: false



    # ./spec/.rubocop.yml

    inherit_from:
    - ../.rubocop.yml

    Blocks:
    Enabled: false

    StringLiterals:
    Enabled: false



    # ./spec/factories/.rubocop.yml

    inherit_from:
    - ../.rubocop.yml

    LineLength:
    Max: 2048