rubocop: In-line Style/HashAsLastArrayItem disablement

- We want to move away from `Excludes:` in the main `.rubocop.yml` config file
  containing full file paths, because it's hard to track whether they're still
  necessary or not (and other occurrences in the files that you might
  legitimately want to improve are unaccounted for).
This commit is contained in:
Issy Long 2023-03-02 22:10:16 +00:00
parent 0384b82adc
commit e05cd2c542
No known key found for this signature in database
GPG Key ID: 8247C390DADC67D4
2 changed files with 4 additions and 6 deletions

View File

@ -65,9 +65,5 @@ Style/DocumentationMethod:
Include:
- "formula.rb"
Style/HashAsLastArrayItem:
Exclude:
- "test/utils/spdx_spec.rb"
Bundler/GemFilename:
Enabled: false

View File

@ -81,7 +81,7 @@ describe SPDX do
license_expression = { any_of: [
"MIT",
:public_domain,
all_of: ["0BSD", "Zlib"],
all_of: ["0BSD", "Zlib"], # rubocop:disable Style/HashAsLastArrayItem
"curl" => { with: "LLVM-exception" },
] }
result = [["MIT", :public_domain, "curl", "0BSD", "Zlib"], ["LLVM-exception"]]
@ -201,7 +201,7 @@ describe SPDX do
license_expression = { any_of: [
"MIT",
:public_domain,
all_of: ["0BSD", "Zlib"],
all_of: ["0BSD", "Zlib"], # rubocop:disable Style/HashAsLastArrayItem
"curl" => { with: "LLVM-exception" },
] }
result = "MIT or Public Domain or (0BSD and Zlib) or (curl with LLVM-exception)"
@ -229,6 +229,7 @@ describe SPDX do
})
end
# rubocop:disable Style/HashAsLastArrayItem
it "handles nested brackets" do
expect(described_class.string_to_license_expression("A and (B or (C and D))")).to eq({
all_of: [
@ -240,6 +241,7 @@ describe SPDX do
],
})
end
# rubocop:enable Style/HashAsLastArrayItem
end
describe ".license_version_info" do