rsim / oracle-enhanced

Oracle enhaced adapter for ActiveRecord
MIT License
545 stars 307 forks source link

Introduce RuboCop RSpec #2274

Closed yahonda closed 2 years ago

yahonda commented 2 years ago

Enabled these "style" cops for now.

RSpec/EmptyLineAfterExampleGroup
RSpec/EmptyLineAfterHook
RSpec/EmptyLineAfterSubject
RSpec/HooksBeforeExamples
$ bundle exec rubocop -a
Inspecting 72 files
...........................................C..C...CCCC..................

Offenses:

spec/active_record/connection_adapters/emulation/oracle_adapter_spec.rb:17:3: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after after.
  end
  ^^^
spec/active_record/connection_adapters/emulation/oracle_adapter_spec.rb:18:3: C: [Corrected] RSpec/HooksBeforeExamples: Move after above the examples in the group.
  after(:all) do ...
  ^^^^^^^^^^^^^^
spec/active_record/connection_adapters/emulation/oracle_adapter_spec.rb:23:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body end.
spec/active_record/connection_adapters/oracle_enhanced/database_tasks_spec.rb:18:5: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after before.
    end
    ^^^
spec/active_record/connection_adapters/oracle_enhanced/database_tasks_spec.rb:22:5: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after after.
    end
    ^^^
spec/active_record/connection_adapters/oracle_enhanced/database_tasks_spec.rb:28:5: C: [Corrected] RSpec/HooksBeforeExamples: Move after above the examples in the group.
    after do ...
    ^^^^^^^^
spec/active_record/connection_adapters/oracle_enhanced/database_tasks_spec.rb:64:7: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after before.
      before { ActiveRecord::Tasks::DatabaseTasks.drop(config) }
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/active_record/connection_adapters/oracle_enhanced/database_tasks_spec.rb:68:5: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after after.
    end
    ^^^
spec/active_record/connection_adapters/oracle_enhanced/database_tasks_spec.rb:71:7: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after before.
      before { ActiveRecord::Tasks::DatabaseTasks.purge(config) }
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/active_record/connection_adapters/oracle_enhanced/database_tasks_spec.rb:86:9: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after before.
        before { ActiveRecord::Tasks::DatabaseTasks.structure_dump(config, temp_file) }
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/active_record/connection_adapters/oracle_enhanced/database_tasks_spec.rb:96:7: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after after.
      end
      ^^^
spec/active_record/connection_adapters/oracle_enhanced/database_tasks_spec.rb:99:9: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after before.
        end
        ^^^
spec/active_record/connection_adapters/oracle_enhanced/database_tasks_spec.rb:105:7: C: [Corrected] RSpec/HooksBeforeExamples: Move after above the examples in the group.
      after do ...
      ^^^^^^^^
spec/active_record/connection_adapters/oracle_enhanced/database_tasks_spec.rb:111:5: C: [Corrected] RSpec/HooksBeforeExamples: Move after above the examples in the group.
    after do ...
    ^^^^^^^^
spec/active_record/connection_adapters/oracle_enhanced/database_tasks_spec.rb:118:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body end.
spec/active_record/connection_adapters/oracle_enhanced/database_tasks_spec.rb:120:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body end.
spec/active_record/connection_adapters/oracle_enhanced/schema_dumper_spec.rb:129:5: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after after.
    end
    ^^^
spec/active_record/connection_adapters/oracle_enhanced/schema_dumper_spec.rb:385:7: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after before.
      end
      ^^^
spec/active_record/connection_adapters/oracle_enhanced/schema_dumper_spec.rb:392:7: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after after.
      end
      ^^^
spec/active_record/connection_adapters/oracle_enhanced/schema_dumper_spec.rb:481:5: C: [Corrected] RSpec/HooksBeforeExamples: Move after above the examples in the group.
    after do ...
    ^^^^^^^^
spec/active_record/connection_adapters/oracle_enhanced/schema_dumper_spec.rb:486:5: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after after.
    end
    ^^^
spec/active_record/connection_adapters/oracle_enhanced/schema_dumper_spec.rb:490:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body end.
spec/active_record/connection_adapters/oracle_enhanced/schema_statements_spec.rb:552:5: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after before.
    end
    ^^^
spec/active_record/connection_adapters/oracle_enhanced/schema_statements_spec.rb:559:5: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after after.
    end
    ^^^
spec/active_record/connection_adapters/oracle_enhanced/schema_statements_spec.rb:601:5: C: [Corrected] RSpec/HooksBeforeExamples: Move after above the examples in the group.
    after do ...
    ^^^^^^^^
spec/active_record/connection_adapters/oracle_enhanced/schema_statements_spec.rb:607:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body end.
spec/active_record/connection_adapters/oracle_enhanced/schema_statements_spec.rb:624:5: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after after.
    end
    ^^^
spec/active_record/connection_adapters/oracle_enhanced/schema_statements_spec.rb:647:5: C: [Corrected] RSpec/HooksBeforeExamples: Move after above the examples in the group.
    after do ...
    ^^^^^^^^
spec/active_record/connection_adapters/oracle_enhanced/schema_statements_spec.rb:654:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body end.
spec/active_record/connection_adapters/oracle_enhanced/schema_statements_spec.rb:1159:7: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after after.
      end
      ^^^
spec/active_record/connection_adapters/oracle_enhanced/schema_statements_spec.rb:1173:7: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after after.
      end
      ^^^
spec/active_record/connection_adapters/oracle_enhanced/schema_statements_spec.rb:1229:5: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after after.
    end
    ^^^
spec/active_record/connection_adapters/oracle_enhanced/schema_statements_spec.rb:1248:5: C: [Corrected] RSpec/HooksBeforeExamples: Move after above the examples in the group.
    after do ...
    ^^^^^^^^
spec/active_record/connection_adapters/oracle_enhanced/schema_statements_spec.rb:1253:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body end.
spec/active_record/connection_adapters/oracle_enhanced/structure_dump_spec.rb:11:3: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after before.
  end
  ^^^
spec/active_record/connection_adapters/oracle_enhanced/structure_dump_spec.rb:245:3: C: [Corrected] RSpec/EmptyLineAfterExampleGroup: Add an empty line after describe.
  end
  ^^^
spec/active_record/connection_adapters/oracle_enhanced/structure_dump_spec.rb:249:5: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after after.
    end
    ^^^
spec/active_record/connection_adapters/oracle_enhanced/structure_dump_spec.rb:263:5: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after before.
    end
    ^^^
spec/active_record/connection_adapters/oracle_enhanced/structure_dump_spec.rb:266:5: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after after.
    end
    ^^^
spec/active_record/connection_adapters/oracle_enhanced/structure_dump_spec.rb:269:5: C: [Corrected] RSpec/EmptyLineAfterSubject: Add an empty line after subject.
    end
    ^^^
spec/active_record/connection_adapters/oracle_enhanced/structure_dump_spec.rb:273:5: C: [Corrected] RSpec/EmptyLineAfterExampleGroup: Add an empty line after context.
    end
    ^^^
spec/active_record/connection_adapters/oracle_enhanced/structure_dump_spec.rb:278:5: C: [Corrected] RSpec/EmptyLineAfterExampleGroup: Add an empty line after context.
    end
    ^^^
spec/active_record/connection_adapters/oracle_enhanced/structure_dump_spec.rb:283:5: C: [Corrected] RSpec/EmptyLineAfterExampleGroup: Add an empty line after context.
    end
    ^^^
spec/active_record/connection_adapters/oracle_enhanced/structure_dump_spec.rb:319:5: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after before.
    end
    ^^^
spec/active_record/connection_adapters/oracle_enhanced/structure_dump_spec.rb:325:5: C: [Corrected] RSpec/HooksBeforeExamples: Move after above the examples in the group.
    after(:each) do ...
    ^^^^^^^^^^^^^^^
spec/active_record/connection_adapters/oracle_enhanced/structure_dump_spec.rb:333:5: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after after.
    end
    ^^^
spec/active_record/connection_adapters/oracle_enhanced/structure_dump_spec.rb:360:5: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after after.
    end
    ^^^
spec/active_record/connection_adapters/oracle_enhanced/structure_dump_spec.rb:383:5: C: [Corrected] RSpec/HooksBeforeExamples: Move after above the examples in the group.
    after do ...
    ^^^^^^^^
spec/active_record/connection_adapters/oracle_enhanced/structure_dump_spec.rb:395:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body end.
spec/active_record/connection_adapters/oracle_enhanced/structure_dump_spec.rb:446:5: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after before.
    end
    ^^^
spec/active_record/connection_adapters/oracle_enhanced/structure_dump_spec.rb:457:5: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after after.
    end
    ^^^
spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb:131:5: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after before.
    end
    ^^^
spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb:138:5: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after after.
    end
    ^^^
spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb:684:5: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after after.
    end
    ^^^
spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb:703:5: C: [Corrected] RSpec/HooksBeforeExamples: Move after above the examples in the group.
    after(:all) do ...
    ^^^^^^^^^^^^^^
spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb:712:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body end.
spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb:723:5: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after before.
    end
    ^^^
spec/active_record/connection_adapters/oracle_enhanced_adapter_spec.rb:729:5: C: [Corrected] RSpec/EmptyLineAfterHook: Add an empty line after after.
    end
    ^^^

72 files inspected, 58 offenses detected, 58 offenses corrected
$
yahonda commented 2 years ago

@koic Would you review this pull request? I'd like to introduce RuboCop RSpec with minimum cops enabled.

koic commented 2 years ago

On the other hand, these cops may be useful.

I think it will detect some warnings, but it's up to you to decide what to do with them.

yahonda commented 2 years ago

Removed RSpec/HooksBeforeExamples cop and added RSpec/ExcessiveDocstringSpacing from the cop list provided for now.

koic commented 2 years ago

This looks good! Thank you!