31 lines
954 B
Ruby
31 lines
954 B
Ruby
require "language/node"
|
|
|
|
class Pyright < Formula
|
|
desc "Static type checker for Python"
|
|
homepage "https://github.com/microsoft/pyright"
|
|
url "https://registry.npmjs.org/pyright/-/pyright-1.1.222.tgz"
|
|
sha256 "d75a6dd1b5722f32e33f8bbd5ba7c169f9583df719b42f0814d0639ea23491b5"
|
|
license "MIT"
|
|
head "https://github.com/microsoft/pyright.git", branch: "main"
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, all: "a2d833eb2e754f2c05cb83945bf10b6a6e3b3a0a7362e209696744da40ac2c6b"
|
|
end
|
|
|
|
depends_on "node"
|
|
|
|
def install
|
|
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
|
|
bin.install_symlink Dir["#{libexec}/bin/*"]
|
|
end
|
|
|
|
test do
|
|
(testpath/"broken.py").write <<~EOS
|
|
def wrong_types(a: int, b: int) -> str:
|
|
return a + b
|
|
EOS
|
|
output = pipe_output("#{bin}/pyright broken.py 2>&1")
|
|
assert_match 'error: Expression of type "int" cannot be assigned to return type "str"', output
|
|
end
|
|
end
|