Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

various formulae: style fixes #80302

Merged
merged 32 commits into from Jul 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
c6b11a0
allureofthestars: style fixes
nandahkrishna Jun 30, 2021
6f2788a
bitchx: style fixes
nandahkrishna Jun 30, 2021
70493a1
blaze: style fixes
nandahkrishna Jun 30, 2021
a39febd
cql: style fixes
nandahkrishna Jun 30, 2021
07c3c75
dmagnetic: style fixes
nandahkrishna Jun 30, 2021
1b5f874
dungeon: style fixes
nandahkrishna Jun 30, 2021
eb9efa8
jdnssec-tools: style fixes
nandahkrishna Jun 30, 2021
117e331
kubeless: style fixes
nandahkrishna Jun 30, 2021
0f2294d
faas-cli: style fixes
nandahkrishna Jun 30, 2021
7a00b2b
fn: style fixes
nandahkrishna Jun 30, 2021
7bbcca7
git-xargs: style fixes
nandahkrishna Jun 30, 2021
521dcc3
jmxtrans: style fixes
nandahkrishna Jun 30, 2021
22c796b
k3d: style fixes
nandahkrishna Jun 30, 2021
608d9de
kubergrunt: style fixes
nandahkrishna Jun 30, 2021
24f4b93
libelf: style fixes
nandahkrishna Jun 30, 2021
06c847a
mockolo: style fixes
nandahkrishna Jun 30, 2021
bc9ae86
molten-vk: style fixes
nandahkrishna Jun 30, 2021
8306188
monero: style fixes
nandahkrishna Jun 30, 2021
ac7939b
parliament: style fixes
nandahkrishna Jun 30, 2021
e3bb314
pmdmini: style fixes
nandahkrishna Jun 30, 2021
5111fa4
rust-analyzer: style fixes
nandahkrishna Jun 30, 2021
fb1f2ba
shallow-backup: style fixes
nandahkrishna Jun 30, 2021
05b41d9
skopeo: style fixes
nandahkrishna Jun 30, 2021
50b8fd7
speech-tools: style fixes
nandahkrishna Jun 30, 2021
4e231a3
sqlcipher: style fixes
nandahkrishna Jun 30, 2021
8e0fe92
step: style fixes
nandahkrishna Jun 30, 2021
e0b237d
texlab: style fixes
nandahkrishna Jun 30, 2021
5534453
volatility: style fixes
nandahkrishna Jun 30, 2021
daa7e92
wownero: style fixes
nandahkrishna Jun 30, 2021
6edfbe9
cidrmerge: style fixes
nandahkrishna Jun 30, 2021
520d467
ocaml: style fixes
nandahkrishna Jun 30, 2021
4cd724d
randomize-lines: style fixes
nandahkrishna Jun 30, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Formula/allureofthestars.rb
Expand Up @@ -28,8 +28,8 @@ def install
test do
assert_equal "",
shell_output("#{bin}/Allure --dbgMsgSer --dbgMsgCli --logPriority 0 --newGame 3 --maxFps 100000 " \
"--stopAfterFrames 50 --automateAll --keepAutomated --gameMode battle " \
"--setDungeonRng \"SMGen 7 7\" --setMainRng \"SMGen 7 7\"")
"--stopAfterFrames 50 --automateAll --keepAutomated --gameMode battle " \
"--setDungeonRng \"SMGen 7 7\" --setMainRng \"SMGen 7 7\"")
assert_equal "", (testpath/".Allure/stderr.txt").read
assert_match "Client FactionId 1 closed frontend.", (testpath/".Allure/stdout.txt").read
end
Expand Down
2 changes: 1 addition & 1 deletion Formula/bitchx.rb
Expand Up @@ -26,7 +26,7 @@ def install
"--mandir=#{man}",
"--enable-ipv6",
"--with-plugins=acro,aim,arcfour,amp,autocycle,blowfish,cavlink,encrypt,fserv," \
"hint,identd,nap,pkga,possum,qbx,qmail",
"hint,identd,nap,pkga,possum,qbx,qmail",
"--with-ssl"
system "make"
system "make", "install"
Expand Down
7 changes: 5 additions & 2 deletions Formula/blaze.rb
Expand Up @@ -44,8 +44,11 @@ def install
}
EOS

expected = "C =\n( -1 -1 )" \
"\n( 0 -4 )\n"
expected = <<~EOS
C =
( -1 -1 )
( 0 -4 )
EOS

system ENV.cxx, "test.cpp", "-std=c++14", "-I#{include}", "-o", "test"
assert_equal expected, shell_output(testpath/"test")
Expand Down
2 changes: 1 addition & 1 deletion Formula/cidrmerge.rb
@@ -1,5 +1,5 @@
class Cidrmerge < Formula
desc "CIDR merging with white listing (network exclusion)"
desc "CIDR merging with network exclusion"
homepage "https://cidrmerge.sourceforge.io"
url "https://downloads.sourceforge.net/project/cidrmerge/cidrmerge/cidrmerge-1.5.3/cidrmerge-1.5.3.tar.gz"
sha256 "21b36fc8004d4fc4edae71dfaf1209d3b7c8f8f282d1a582771c43522d84f088"
Expand Down
4 changes: 2 additions & 2 deletions Formula/cql.rb
Expand Up @@ -20,8 +20,8 @@ def install
ENV["CGO_ENABLED"] = "1"

ldflags = "-s -w -X main.version=v#{version} " \
"-X github.com/CovenantSQL/CovenantSQL/conf.RoleTag=C " \
"-X github.com/CovenantSQL/CovenantSQL/utils/log.SimpleLog=Y"
"-X github.com/CovenantSQL/CovenantSQL/conf.RoleTag=C " \
"-X github.com/CovenantSQL/CovenantSQL/utils/log.SimpleLog=Y"
system "go", "build", *std_go_args, "-tags", "sqlite_omit_load_extension",
"-ldflags", ldflags, "./cmd/cql"

Expand Down
8 changes: 4 additions & 4 deletions Formula/dmagnetic.rb
Expand Up @@ -20,9 +20,9 @@ def install
test do
assert_match "ab9ec7787593e310ac4d8187db3f6cee", \
shell_output("echo Hello | #{bin}/dMagnetic "\
"-vmode none -vcols 300 -vrows 300 -vecho -sres 1024x768 "\
"-mag #{share}/games/dMagnetic/minitest.mag "\
"-gfx #{share}/games/dMagnetic/minitest.gfx "\
"| md5").strip
"-vmode none -vcols 300 -vrows 300 -vecho -sres 1024x768 "\
"-mag #{share}/games/dMagnetic/minitest.mag "\
"-gfx #{share}/games/dMagnetic/minitest.gfx "\
"| md5").strip
end
end
4 changes: 2 additions & 2 deletions Formula/dungeon.rb
Expand Up @@ -18,8 +18,8 @@ def install
# look for game files where homebrew installed them, not pwd
inreplace "game.f" do |s|
s.gsub! "FILE='dindx',STATUS='OLD',", "FILE='#{opt_pkgshare}/dindx',"
s.gsub! "1\tFORM='FORMATTED',ACCESS='SEQUENTIAL',ERR=1900)", "1\tSTATUS='OLD',FORM='FORMATTED',
\t2\tACCESS='SEQUENTIAL',ERR=1900)"
s.gsub! "1\tFORM='FORMATTED',ACCESS='SEQUENTIAL',ERR=1900)", "1\tSTATUS='OLD',FORM='FORMATTED'," \
"\n\t2\tACCESS='SEQUENTIAL',ERR=1900)"
s.gsub! "FILE='dtext',STATUS='OLD',", "FILE='#{opt_pkgshare}/dtext',"
s.gsub! "1\tFORM='UNFORMATTED',ACCESS='DIRECT',", "1\tSTATUS='OLD',FORM='UNFORMATTED',ACCESS='DIRECT',"
end
Expand Down
4 changes: 2 additions & 2 deletions Formula/faas-cli.rb
Expand Up @@ -48,8 +48,8 @@ def install
socket = server.accept
response = "OK"
socket.print "HTTP/1.1 200 OK\r\n" \
"Content-Length: #{response.bytesize}\r\n" \
"Connection: close\r\n"
"Content-Length: #{response.bytesize}\r\n" \
"Connection: close\r\n"
socket.print "\r\n"
socket.print response
socket.close
Expand Down
14 changes: 9 additions & 5 deletions Formula/fn.rb
Expand Up @@ -27,13 +27,17 @@ def install
server = TCPServer.new("localhost", port)
pid = fork do
loop do
response = {
id: "01CQNY9PADNG8G00GZJ000000A",
name: "myapp",
created_at: "2018-09-18T08:56:08.269Z",
updated_at: "2018-09-18T08:56:08.269Z",
}.to_json

socket = server.accept
response =
'{"id":"01CQNY9PADNG8G00GZJ000000A","name":"myapp",' \
'"created_at":"2018-09-18T08:56:08.269Z","updated_at":"2018-09-18T08:56:08.269Z"}'
socket.print "HTTP/1.1 200 OK\r\n" \
"Content-Length: #{response.bytesize}\r\n" \
"Connection: close\r\n"
"Content-Length: #{response.bytesize}\r\n" \
"Connection: close\r\n"
socket.print "\r\n"
socket.print response
socket.close
Expand Down
6 changes: 3 additions & 3 deletions Formula/git-xargs.rb
Expand Up @@ -23,8 +23,8 @@ def install

assert_match "You must export a valid Github personal access token as GITHUB_OAUTH_TOKEN",
shell_output("#{bin}/git-xargs --branch-name test-branch" \
"--github-org brew-test-org" \
"--commit-message 'Create hello-world.txt'" \
"touch hello-world.txt 2>&1", 1)
"--github-org brew-test-org" \
"--commit-message 'Create hello-world.txt'" \
"touch hello-world.txt 2>&1", 1)
end
end
8 changes: 4 additions & 4 deletions Formula/jdnssec-tools.rb
Expand Up @@ -30,14 +30,14 @@ def install
end

test do
(testpath/"powerdns.com.key").write(
"powerdns.com. 10773 IN DNSKEY 257 3 8 (AwEAAb/+pXOZWYQ8mv9WM5dFva8
(testpath/"powerdns.com.key").write <<~EOS
powerdns.com. 10773 IN DNSKEY 257 3 8 (AwEAAb/+pXOZWYQ8mv9WM5dFva8
WU9jcIUdDuEjldbyfnkQ/xlrJC5zA EfhYhrea3SmIPmMTDimLqbh3/4SMTNPTUF+9+U1vp
NfIRTFadqsmuU9F ddz3JqCcYwEpWbReg6DJOeyu+9oBoIQkPxFyLtIXEPGlQzrynKubn04
Cx83I6NfzDTraJT3jLHKeW5PVc1ifqKzHz5TXdHHTA7NkJAa0sPcZCoNE 1LpnJI/wcUpRU
iuQhoLFeT1E432GuPuZ7y+agElGj0NnBxEgnHrhrnZW UbULpRa/il+Cr5Taj988HqX9Xdm
6FjcP4Lbuds/44U7U8du224Q8jTrZ 57Yvj4VDQKc=)",
)
6FjcP4Lbuds/44U7U8du224Q8jTrZ 57Yvj4VDQKc=)
EOS

assert_match "D4C3D5552B8679FAEEBC317E5F048B614B2E5F607DC57F1553182D49AB2179F7",
shell_output("#{bin}/jdnssec-dstool -d 2 powerdns.com.key")
Expand Down
2 changes: 1 addition & 1 deletion Formula/jmxtrans.rb
Expand Up @@ -26,7 +26,7 @@ def install
cd "jmxtrans" do
# Point JAR_FILE into Cellar where we've installed the jar file
inreplace "jmxtrans.sh", "$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )/../lib\" "\
">/dev/null && pwd )/jmxtrans-all.jar",
">/dev/null && pwd )/jmxtrans-all.jar",
libexec/"target/jmxtrans-#{version}-all.jar"

# Exec java to avoid forking the server into a new process
Expand Down
2 changes: 1 addition & 1 deletion Formula/k3d.rb
Expand Up @@ -23,7 +23,7 @@ def install
system "go", "build",
"-mod", "vendor",
"-ldflags", "-s -w -X github.com/rancher/k3d/v#{version.major}/version.Version=v#{version}"\
" -X github.com/rancher/k3d/v#{version.major}/version.K3sVersion=latest",
" -X github.com/rancher/k3d/v#{version.major}/version.K3sVersion=latest",
"-trimpath", "-o", bin/"k3d"

# Install bash completion
Expand Down
43 changes: 26 additions & 17 deletions Formula/kubeless.rb
Expand Up @@ -33,41 +33,50 @@ def install
socket = server.accept
request = socket.gets
request_path = request.split[1]
runtime_images_data = <<-'EOS'.gsub(/\s+/, "")
[{
\"ID\": \"python\",
\"versions\": [{
\"name\": \"python27\",
\"version\": \"2.7\",
\"httpImage\": \"kubeless/python\"
}]
}]
EOS
response = case request_path
when "/api/v1/namespaces/kubeless/configmaps/kubeless-config"
'{
<<-EOS
{
"kind": "ConfigMap",
"apiVersion": "v1",
"metadata": { "name": "kubeless-config", "namespace": "kubeless" },
"data": {
"runtime-images": "[{' \
'\"ID\": \"python\",' \
'\"versions\": [{' \
'\"name\": \"python27\",' \
'\"version\": \"2.7\",' \
'\"httpImage\": \"kubeless/python\"' \
"}]" \
'}]"
}
}'
"runtime-images": "#{runtime_images_data}"
}
}
EOS
when "/apis/kubeless.io/v1beta1/namespaces/default/functions"
'{
<<-EOS
{
"apiVersion": "kubeless.io/v1beta1",
"kind": "Function",
"metadata": { "name": "get-python", "namespace": "default" }
}'
}
EOS
when "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/functions.kubeless.io"
'{
<<-EOS
{
"apiVersion": "apiextensions.k8s.io/v1beta1",
"kind": "CustomResourceDefinition",
"metadata": { "name": "functions.kubeless.io" }
}'
}
EOS
else
"OK"
end
socket.print "HTTP/1.1 200 OK\r\n" \
"Content-Length: #{response.bytesize}\r\n" \
"Connection: close\r\n"
"Content-Length: #{response.bytesize}\r\n" \
"Connection: close\r\n"
socket.print "\r\n"
socket.print response
socket.close
Expand Down
4 changes: 2 additions & 2 deletions Formula/kubergrunt.rb
Expand Up @@ -20,11 +20,11 @@ def install

test do
output = shell_output("#{bin}/kubergrunt eks verify --eks-cluster-arn " \
"arn:aws:eks:us-east-1:123:cluster/brew-test 2>&1", 1)
"arn:aws:eks:us-east-1:123:cluster/brew-test 2>&1", 1)
assert_match "ERROR: Error finding AWS credentials", output

output = shell_output("#{bin}/kubergrunt tls gen --namespace test " \
"--secret-name test --ca-secret-name test 2>&1", 1)
"--secret-name test --ca-secret-name test 2>&1", 1)
assert_match "ERROR: --tls-common-name is required", output
end
end
6 changes: 3 additions & 3 deletions Formula/libelf.rb
Expand Up @@ -55,9 +55,9 @@ def install

test do
elf_content = "7F454C460101010000000000000000000200030001000000548004083" \
"4000000000000000000000034002000010000000000000001000000000000000080040" \
"80080040874000000740000000500000000100000B00431DB43B96980040831D2B20CC" \
"D8031C040CD8048656C6C6F20776F726C640A"
"4000000000000000000000034002000010000000000000001000000000000000080040" \
"80080040874000000740000000500000000100000B00431DB43B96980040831D2B20CC" \
"D8031C040CD8048656C6C6F20776F726C640A"
File.open(testpath/"elf", "w+b") do |file|
file.write([elf_content].pack("H*"))
end
Expand Down
55 changes: 29 additions & 26 deletions Formula/mockolo.rb
Expand Up @@ -18,36 +18,39 @@ def install
end

test do
(testpath/"testfile.swift").write("
/// @mockable
public protocol Foo {
var num: Int { get set }
func bar(arg: Float) -> String
}")
(testpath/"testfile.swift").write <<~EOS
/// @mockable
public protocol Foo {
var num: Int { get set }
func bar(arg: Float) -> String
}
EOS
system "#{bin}/mockolo", "-srcs", testpath/"testfile.swift", "-d", testpath/"GeneratedMocks.swift"
assert_predicate testpath/"GeneratedMocks.swift", :exist?
assert_equal "
///
/// @Generated by Mockolo
///
public class FooMock: Foo {
public init() { }
public init(num: Int = 0) {
self.num = num
}
output = <<~EOS.gsub(/\s+/, "").strip
///
/// @Generated by Mockolo
///
public class FooMock: Foo {
public init() { }
public init(num: Int = 0) {
self.num = num
}

public private(set) var numSetCallCount = 0
public var num: Int = 0 { didSet { numSetCallCount += 1 } }
public private(set) var numSetCallCount = 0
public var num: Int = 0 { didSet { numSetCallCount += 1 } }

public private(set) var barCallCount = 0
public var barHandler: ((Float) -> (String))?
public func bar(arg: Float) -> String {
barCallCount += 1
if let barHandler = barHandler {
return barHandler(arg)
}
return \"\"
public private(set) var barCallCount = 0
public var barHandler: ((Float) -> (String))?
public func bar(arg: Float) -> String {
barCallCount += 1
if let barHandler = barHandler {
return barHandler(arg)
}
return ""
}
}
}".gsub(/\s+/, "").strip, shell_output("cat #{testpath/"GeneratedMocks.swift"}").gsub(/\s+/, "").strip
EOS
assert_equal output, shell_output("cat #{testpath/"GeneratedMocks.swift"}").gsub(/\s+/, "").strip
end
end
6 changes: 3 additions & 3 deletions Formula/molten-vk.rb
Expand Up @@ -94,19 +94,19 @@ def install
xcodebuild "-quiet", "-create-xcframework",
"-output", "External/build/Latest/SPIRVCross.xcframework",
"-library", "External/build/Intermediates/XCFrameworkStaging/" \
"Release/Platform/libSPIRVCross.a"
"Release/Platform/libSPIRVCross.a"

# Create SPIRVTools.xcframework
xcodebuild "-quiet", "-create-xcframework",
"-output", "External/build/Latest/SPIRVTools.xcframework",
"-library", "External/build/Intermediates/XCFrameworkStaging/" \
"Release/Platform/libSPIRVTools.a"
"Release/Platform/libSPIRVTools.a"

# Created glslang.xcframework
xcodebuild "-quiet", "-create-xcframework",
"-output", "External/build/Latest/glslang.xcframework",
"-library", "External/build/Intermediates/XCFrameworkStaging/" \
"Release/Platform/libglslang.a"
"Release/Platform/libglslang.a"

# Build MoltenVK Package
xcodebuild "-project", "MoltenVKPackaging.xcodeproj",
Expand Down
10 changes: 5 additions & 5 deletions Formula/monero.rb
Expand Up @@ -70,11 +70,11 @@ def plist

test do
cmd = "yes '' | #{bin}/monero-wallet-cli --restore-deterministic-wallet " \
"--password brew-test --restore-height 1 --generate-new-wallet wallet " \
"--electrum-seed 'baptism cousin whole exquisite bobsled fuselage left " \
"scoop emerge puzzled diet reinvest basin feast nautical upon mullet " \
"ponies sixteen refer enhanced maul aztec bemused basin'" \
"--command address"
"--password brew-test --restore-height 1 --generate-new-wallet wallet " \
"--electrum-seed 'baptism cousin whole exquisite bobsled fuselage left " \
"scoop emerge puzzled diet reinvest basin feast nautical upon mullet " \
"ponies sixteen refer enhanced maul aztec bemused basin'" \
"--command address"
address = "4BDtRc8Ym9wGzx8vpkQQvpejxBNVpjEmVBebBPCT4XqvMxW3YaCALFraiQibejyMAxUXB5zqn4pVgHVm3JzhP2WzVAJDpHf"
assert_equal address, shell_output(cmd).lines.last.split[1]
end
Expand Down
2 changes: 1 addition & 1 deletion Formula/ocaml.rb
Expand Up @@ -32,7 +32,7 @@ class Ocaml < Formula

pour_bottle? do
# The ocaml compilers embed prefix information in weird ways that the default
# brew detection doesn't find, and so needs to be explicitly blacklisted.
# brew detection doesn't find, and so needs to be explicitly blocked.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure why infer failed to build on Intel Big Sur. It was built/tested only because of ocaml, which has a syntax-only change in a comment.

If we can ignore this failure, the PR should be good to merge, I think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me. Thanks @nandahkrishna!

reason "The bottle needs to be installed into #{Homebrew::DEFAULT_PREFIX}."
satisfy { HOMEBREW_PREFIX.to_s == Homebrew::DEFAULT_PREFIX }
end
Expand Down
2 changes: 1 addition & 1 deletion Formula/parliament.rb
Expand Up @@ -73,7 +73,7 @@ def install

test do
assert_equal "MEDIUM - No resources match for the given action - - [{'action': 's3:GetObject',"\
" 'required_format': 'arn:*:s3:::*/*'}] - {'line': 1, 'column': 40, 'filepath': None}", \
" 'required_format': 'arn:*:s3:::*/*'}] - {'line': 1, 'column': 40, 'filepath': None}", \
pipe_output("#{bin}/parliament --string \'{\"Version\": \"2012-10-17\", \"Statement\": {\"Effect\": \"Allow\","\
" \"Action\": \"s3:GetObject\", \"Resource\": \"arn:aws:s3:::secretbucket\"}}\'").strip
end
Expand Down
5 changes: 3 additions & 2 deletions Formula/pmdmini.rb
Expand Up @@ -28,8 +28,9 @@ def install
system "make"

# Makefile doesn't build a dylib
system "#{ENV.cc} -dynamiclib -install_name #{lib}/libpmdmini.dylib " \
"-o libpmdmini.dylib -undefined dynamic_lookup obj/*.o"
system ENV.cc, "-dynamiclib", "-install_name", "#{lib}/libpmdmini.dylib",
"-o", "libpmdmini.dylib", "-undefined", "dynamic_lookup",
*Dir["obj/*.o"]

bin.install "pmdplay"
lib.install "libpmdmini.a", "libpmdmini.dylib"
Expand Down