This requires changes to the cli at all levels, since the cli was not originally designed to be interactive. Have the /cli API endpoint ask for confirmation via an ubi-confirm header. Make bin/ubi recognize the ubi-confirm header and prompt the user for confirmation. The confirmation value is sent in the top level --confirm option. Change UbiCli.destroy, used for both vm and pg destory to support an -f/--force option to destroy without asking for confirmation. Unless the -f option is given, it asks for confirmation. If confirmation is already provided, and it is correct, it runs the destroy command. If the confirmation is already provided and it is incorrect, an error is returned. To ease implementation of this in bin/ubi, a 1.times do block is used. If confirmation is required, argv is prepended with the --confirm option and confirmation value, and then redo is used to send another request. Rubocop doesn't understand this and tries to remove the 1.times do, breaking the code, so disable that cop.
93 lines
1.4 KiB
YAML
93 lines
1.4 KiB
YAML
# Modified from https://www.fastruby.io/blog/ruby/code-quality/how-we-use-rubocop-and-standardrb.html
|
|
require:
|
|
- rubocop-capybara
|
|
- rubocop-erb
|
|
- rubocop-performance
|
|
- rubocop-rake
|
|
- rubocop-rspec
|
|
- rubocop-sequel
|
|
- standard
|
|
|
|
inherit_gem:
|
|
standard: config/base.yml
|
|
|
|
AllCops:
|
|
TargetRubyVersion: 3.2
|
|
NewCops: enable
|
|
Exclude:
|
|
- public/**/*
|
|
- vendor/**/*
|
|
- node_modules/**/*
|
|
- coverage/views/*
|
|
|
|
RSpec:
|
|
Enabled: true
|
|
|
|
Performance:
|
|
Enabled: true
|
|
|
|
Rake:
|
|
Enabled: true
|
|
|
|
Sequel:
|
|
Enabled: true
|
|
|
|
RSpec/DescribeMethod:
|
|
Enabled: false
|
|
|
|
Style/FrozenStringLiteralComment:
|
|
Enabled: true
|
|
|
|
Style/BlockComments:
|
|
Enabled: false
|
|
|
|
Layout/HeredocIndentation:
|
|
Enabled: false
|
|
|
|
Layout/SpaceInsideHashLiteralBraces:
|
|
Exclude:
|
|
- 'views/**/*.erb'
|
|
|
|
Layout/EmptyLinesAroundMethodBody:
|
|
Enabled: false
|
|
|
|
RSpec/AnyInstance:
|
|
Enabled: false
|
|
|
|
RSpec/ExampleLength:
|
|
Enabled: false
|
|
|
|
RSpec/MultipleExpectations:
|
|
Enabled: false
|
|
|
|
RSpec/StubbedMock:
|
|
Enabled: false
|
|
|
|
RSpec/MessageSpies:
|
|
Enabled: false
|
|
|
|
RSpec/SubjectStub:
|
|
Enabled: false
|
|
|
|
RSpec/ExpectInHook:
|
|
Enabled: false
|
|
|
|
RSpec/InstanceVariable:
|
|
Enabled: false
|
|
|
|
RSpec/SpecFilePathFormat:
|
|
Exclude:
|
|
- 'spec/routes/**/*.rb'
|
|
|
|
RSpec/MultipleMemoizedHelpers:
|
|
Enabled: false
|
|
|
|
Sequel/IrreversibleMigration:
|
|
Enabled: false
|
|
|
|
Capybara/ClickLinkOrButtonStyle:
|
|
EnforcedStyle: strict
|
|
|
|
Lint/UselessTimes:
|
|
Enabled: false
|