Merge pull request #14871 from issyl0/rubocop-inline-disables

rubocop: Alphabetise, remove config that's default, in-line some disables
This commit is contained in:
Issy Long 2023-03-03 12:10:14 +00:00 committed by GitHub
commit 61cb843cbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 14 deletions

View File

@ -377,11 +377,6 @@ Style/FetchEnvVar:
- "/**/Formula/**/*.rb"
- "**/Formula/**/*.rb"
# Prefer tokens with type annotations for consistency
# between formatting numbers and strings.
Style/FormatStringToken:
EnforcedStyle: annotated
# Not used for casks and formulae.
Style/FrozenStringLiteralComment:
EnforcedStyle: always

View File

@ -1,6 +1,9 @@
inherit_from:
- ../.rubocop.yml
Bundler/GemFilename:
Enabled: false
Homebrew/MoveToExtendOS:
Enabled: true
Exclude:
@ -64,10 +67,3 @@ Style/Documentation:
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