Skip to content

Commit

Permalink
Enable RSpec/ExcessiveDocstringSpacing (#9813)
Browse files Browse the repository at this point in the history
* Enable RSpec/ExcessiveDocstringSpacing

* fixing new instances of ExcessiveDocstringSpacing

---------

Co-authored-by: Garry L Hurley Jr <166545206+GarryHurleyJr@users.noreply.github.com>
  • Loading branch information
robaiken and GarryHurleyJr authored Jun 5, 2024
1 parent 97fa41e commit 11292c0
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 28 deletions.
14 changes: 0 additions & 14 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,6 @@ RSpec/ExampleWording:
- 'updater/spec/dependabot/job_spec.rb'
- 'updater/spec/dependabot/update_files_command_spec.rb'

# Offense count: 14
# This cop supports safe autocorrection (--autocorrect).
RSpec/ExcessiveDocstringSpacing:
Exclude:
- 'common/spec/dependabot/config/ignore_condition_spec.rb'
- 'common/spec/dependabot/file_parsers/base/dependency_set_spec.rb'
- 'common/spec/dependabot/shared_helpers_spec.rb'
- 'devcontainers/spec/dependabot/devcontainers/update_checker_spec.rb'
- 'go_modules/spec/dependabot/go_modules/update_checker_spec.rb'
- 'pub/spec/dependabot/pub/file_fetcher_spec.rb'
- 'pub/spec/dependabot/pub/update_checker_spec.rb'
- 'updater/spec/dependabot/file_fetcher_command_spec.rb'
- 'updater/spec/dependabot/updater_spec.rb'

# Offense count: 17
# This cop supports safe autocorrection (--autocorrect).
RSpec/ExpectActual:
Expand Down
2 changes: 1 addition & 1 deletion common/spec/dependabot/config/ignore_condition_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def expect_ignored(versions)
let(:security_updates_only) { true }
let(:update_types) { %w(version-update:semver-major version-update:semver-patch) }

it "allows all " do
it "allows all" do
expect_allowed(patch_upgrades + minor_upgrades + major_upgrades)
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
it { is_expected.to be_a(described_class) }
its(:dependencies) { is_expected.to eq([dependency]) }

it "delegates to << " do
it "delegates to <<" do
expect(dependency_set).to receive(:<<).with(dependency).and_call_original
plus_dependencies
end
Expand Down
4 changes: 2 additions & 2 deletions common/spec/dependabot/shared_helpers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def existing_tmp_folders
context "with a missing directory" do
let(:directory) { "missing/directory" }

it "creates the missing directory " do
it "creates the missing directory" do
expect(in_a_temporary_repo_directory)
.to eq(Pathname.new(repo_contents_path).join(directory).to_s)
end
Expand All @@ -87,7 +87,7 @@ def existing_tmp_folders

let(:on_create) { -> { `stat some-file.txt 2>&1` } }

it "resets the changes " do
it "resets the changes" do
expect(in_a_temporary_repo_directory)
.to include("No such file or directory")
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
it { is_expected.to be_falsey }
end

context "when the config is in .devcontainer folder " do
context "when the config is in .devcontainer folder" do
let(:project_name) { "config_in_dot_devcontainer_folder" }
let(:directory) { "/.devcontainer" }

Expand All @@ -72,7 +72,7 @@
it { is_expected.to be_truthy }
end

context "when the config is in .devcontainer folder " do
context "when the config is in .devcontainer folder" do
let(:project_name) { "config_in_dot_devcontainer_folder" }
let(:directory) { "/.devcontainer" }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ module foobar
context "when the current version is not vulnerable" do
let(:dependency_version) { "1.0.0" }

it "raises an error " do
it "raises an error" do
expect { lowest_resolvable_security_fix_version.to }.to raise_error(RuntimeError) do |error|
expect(error.message).to eq("Dependency not vulnerable!")
end
Expand Down
6 changes: 3 additions & 3 deletions pub/spec/dependabot/pub/file_fetcher_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
end

context "with pubspec.yaml and pubspec.lock" do
it "fetches the files" do
it "fetches the files" do
expect(file_fetcher_instance.files.map(&:name))
.to match_array(%w(pubspec.yaml pubspec.lock))
end
Expand All @@ -37,7 +37,7 @@
let(:project_name) { "mono_repo" }
let(:directory) { "/main" }

it "fetches the files" do
it "fetches the files" do
expect(file_fetcher_instance.files.map(&:name))
.to match_array(%w(pubspec.yaml pubspec.lock ../dep/pubspec.yaml))
end
Expand All @@ -47,7 +47,7 @@
let(:project_name) { "no_lockfile" }
let(:directory) { "/main" }

it "fetches the files" do
it "fetches the files" do
expect(file_fetcher_instance.files.map(&:name))
.to match_array(%w(pubspec.yaml ../dep/pubspec.yaml))
end
Expand Down
2 changes: 1 addition & 1 deletion pub/spec/dependabot/pub/update_checker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@
context "when the current version is not newest but also not vulnerable" do
let(:dependency_version) { "3.0.0" } # 3.1.0 is latest

it "raises an error " do
it "raises an error" do
expect { lowest_resolvable_security_fix_version.to }.to raise_error(RuntimeError) do |error|
expect(error.message).to eq("Dependency not vulnerable!")
end
Expand Down
4 changes: 2 additions & 2 deletions updater/spec/dependabot/file_fetcher_command_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
end
end

context "when the fetcher raises a file fetcher error (cloud) ", vcr: true do
context "when the fetcher raises a file fetcher error (cloud)", vcr: true do
before do
allow_any_instance_of(Dependabot::Bundler::FileFetcher)
.to receive(:commit)
Expand Down Expand Up @@ -172,7 +172,7 @@
end
end

context "when the fetcher raises a file fetcher error (ghes) ", vcr: true do
context "when the fetcher raises a file fetcher error (ghes)", vcr: true do
before do
allow_any_instance_of(Dependabot::Bundler::FileFetcher)
.to receive(:commit)
Expand Down
2 changes: 1 addition & 1 deletion updater/spec/dependabot/updater_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,7 @@ def expect_update_checker_with_ignored_versions(versions, dependency_matcher: an
end
end

context "when an unknown error is raised while updating dependencies (cloud) " do
context "when an unknown error is raised while updating dependencies (cloud)" do
before do
Dependabot::Experiments.register(:record_update_job_unknown_error, true)
end
Expand Down

0 comments on commit 11292c0

Please sign in to comment.