Skip to content

Commit

Permalink
enable Lint/* and autoformat
Browse files Browse the repository at this point in the history
  • Loading branch information
thepwagner committed Jun 17, 2021
1 parent 84a82a6 commit c07b6cd
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 17 deletions.
34 changes: 34 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,72 @@ Layout/RescueEnsureAlignment:
Enabled: false
Layout/SpaceAroundMethodCallOperator:
Enabled: false
Lint/AmbiguousAssignment:
Enabled: true
Lint/BinaryOperatorWithIdenticalOperands:
Enabled: true
Lint/DeprecatedConstants:
Enabled: true
Lint/DeprecatedOpenSSLConstant:
Enabled: false
Lint/DuplicateBranch:
Enabled: false
Lint/DuplicateElsifCondition:
Enabled: false
Lint/DuplicateRegexpCharacterClassElement:
Enabled: true
Lint/DuplicateRequire:
Enabled: true
Lint/DuplicateRescueException:
Enabled: true
Lint/EmptyBlock:
Enabled: true
Lint/EmptyClass:
Enabled: true
Lint/EmptyConditionalBody:
Enabled: true
Lint/EmptyFile:
Enabled: true
Lint/EmptyInPattern:
Enabled: true
Lint/FloatComparison:
Enabled: true
Lint/LambdaWithoutLiteralBlock:
Enabled: true
Lint/MissingSuper:
Enabled: false
Lint/MixedRegexpCaptureTypes:
Enabled: false
Lint/NoReturnInBeginEndBlocks:
Enabled: false
Lint/NumberedParameterAssignment:
Enabled: true
Lint/OrAssignmentToConstant:
Enabled: true
Lint/OutOfRangeRegexpRef:
Enabled: true
Lint/RaiseException:
Enabled: false
Lint/RedundantDirGlobSort:
Enabled: true
Lint/SelfAssignment:
Enabled: true
Lint/StructNewOverride:
Enabled: false
Lint/SymbolConversion:
Enabled: true
Lint/ToEnumArguments:
Enabled: true
Lint/TopLevelReturnWithArgument:
Enabled: true
Lint/TrailingCommaInAttributeDeclaration:
Enabled: true
Lint/TripleQuotes:
Enabled: true
Lint/UnexpectedBlockArity:
Enabled: true
Lint/UnmodifiedReduceAccumulator:
Enabled: true
Lint/UnreachableLoop:
Enabled: true
Lint/UselessMethodDefinition:
Expand Down
2 changes: 1 addition & 1 deletion common/spec/dependabot/file_fetchers/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,7 @@ def fetch_files
# `git clone` against a file:// URL that is filled by the test
let(:repo_path) { Dir.mktmpdir }
after { FileUtils.rm_rf(repo_path) }
let(:fill_repo) {}
let(:fill_repo) { nil }
before do
Dir.chdir(repo_path) do
`git init .`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def commits_details(base:, head:)
end

context "with a security vulnerability fixed" do
let(:vulnerabilities_fixed) { { "business": [{}] } }
let(:vulnerabilities_fixed) { { business: [{}] } }
it { is_expected.to start_with("[Security] Bump business") }
end

Expand Down Expand Up @@ -446,7 +446,7 @@ def commits_details(base:, head:)
end

context "with a security vulnerability fixed" do
let(:vulnerabilities_fixed) { { "business": [{}] } }
let(:vulnerabilities_fixed) { { business: [{}] } }
it { is_expected.to start_with("chore(deps): [security] bump") }
end

Expand Down Expand Up @@ -489,7 +489,7 @@ def commits_details(base:, head:)
end

context "with a security vulnerability fixed" do
let(:vulnerabilities_fixed) { { "business": [{}] } }
let(:vulnerabilities_fixed) { { business: [{}] } }
it { is_expected.to start_with("Upgrade: [Security] Bump") }
end
end
Expand All @@ -505,7 +505,7 @@ def commits_details(base:, head:)
it { is_expected.to start_with("⬆️ Bump business") }

context "with a security vulnerability fixed" do
let(:vulnerabilities_fixed) { { "business": [{}] } }
let(:vulnerabilities_fixed) { { business: [{}] } }
it { is_expected.to start_with("⬆️🔒 Bump business") }
end
end
Expand Down Expand Up @@ -613,7 +613,7 @@ def commits_details(base:, head:)
end

context "with a security vulnerability fixed" do
let(:vulnerabilities_fixed) { { "business": [{}] } }
let(:vulnerabilities_fixed) { { business: [{}] } }
it { is_expected.to start_with("[Security] Update business") }
end

Expand Down Expand Up @@ -667,7 +667,7 @@ def commits_details(base:, head:)
end

context "with a security vulnerability fixed" do
let(:vulnerabilities_fixed) { { "business": [{}] } }
let(:vulnerabilities_fixed) { { business: [{}] } }
it { is_expected.to start_with("chore(deps): [security] update") }
end
end
Expand All @@ -687,7 +687,7 @@ def commits_details(base:, head:)
end

context "with a security vulnerability fixed" do
let(:vulnerabilities_fixed) { { "business": [{}] } }
let(:vulnerabilities_fixed) { { business: [{}] } }
it { is_expected.to start_with("Upgrade: [Security] Update") }
end
end
Expand Down Expand Up @@ -1807,7 +1807,7 @@ def commits_details(base:, head:)
it { is_expected.to start_with(":arrow_up: Bump ") }

context "with a security vulnerability fixed" do
let(:vulnerabilities_fixed) { { "business": [{}] } }
let(:vulnerabilities_fixed) { { business: [{}] } }
it { is_expected.to start_with(":arrow_up::lock: Bump ") }
end
end
Expand Down
2 changes: 1 addition & 1 deletion gradle/spec/dependabot/gradle/version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
end

describe "#<=>" do
subject { version.send(:"<=>", other_version) }
subject { version.send(:<=>, other_version) }

context "compared to a Gem::Version" do
context "that is lower" do
Expand Down
2 changes: 1 addition & 1 deletion maven/spec/dependabot/maven/version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
end

describe "#<=>" do
subject { version.send(:"<=>", other_version) }
subject { version.send(:<=>, other_version) }

context "compared to a Gem::Version" do
context "that is lower" do
Expand Down
12 changes: 6 additions & 6 deletions terraform/spec/dependabot/terraform/registry_client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
stub_request(:get, "https://#{hostname}/v1/providers/hashicorp/aws/versions").and_return(
status: 200,
body: {
"id": "hashicorp/aws",
"versions": [{ "version": "3.42.0" }, { "version": "3.41.0" }]
id: "hashicorp/aws",
versions: [{ version: "3.42.0" }, { version: "3.41.0" }]
}.to_json
)
client = described_class.new(hostname: hostname)
Expand Down Expand Up @@ -97,7 +97,7 @@
"providers.v1": "/v1/providers/"
}.to_json)
stub_request(:get, "https://#{hostname}/v1/providers/x/y/versions").
and_return(body: { "id": "x/y", "versions": [{ "version": "0.1.0" }] }.to_json)
and_return(body: { id: "x/y", versions: [{ version: "0.1.0" }] }.to_json)
client = described_class.new(hostname: hostname, credentials: credentials)

expect(client.all_provider_versions(identifier: "x/y")).to match_array([
Expand Down Expand Up @@ -126,10 +126,10 @@
}.to_json)
stub_request(:get, "https://#{hostname}/api/registry/v1/modules/hashicorp/consul/aws/versions").
and_return(status: 200, body: {
"modules": [
modules: [
{
"source": "hashicorp/consul/aws",
"versions": [{ "version": "0.1.0" }, { "version": "0.2.0" }]
source: "hashicorp/consul/aws",
versions: [{ version: "0.1.0" }, { version: "0.2.0" }]
}
]
}.to_json)
Expand Down

0 comments on commit c07b6cd

Please sign in to comment.