59 lines
2.7 KiB
Ruby
59 lines
2.7 KiB
Ruby
class Bandit < Formula
|
|
include Language::Python::Virtualenv
|
|
|
|
desc "Security-oriented static analyser for Python code"
|
|
homepage "https://github.com/PyCQA/bandit"
|
|
url "https://files.pythonhosted.org/packages/39/36/a37a2f6f8d0ed8c3bc616616ed5019e1df2680bd8b7df49ceae80fd457de/bandit-1.7.4.tar.gz"
|
|
sha256 "2d63a8c573417bae338962d4b9b06fbc6080f74ecd955a092849e1e65c717bd2"
|
|
license "Apache-2.0"
|
|
head "https://github.com/PyCQA/bandit.git", branch: "main"
|
|
|
|
bottle do
|
|
rebuild 1
|
|
sha256 cellar: :any_skip_relocation, arm64_monterey: "14110d1b516f048375dd47d3089f62b5eb747877475f8cb65d3865d743996cf9"
|
|
sha256 cellar: :any_skip_relocation, arm64_big_sur: "e8f357c1e173913e58934a40df41449b88a29c0471a775048dae70f8ab9bc209"
|
|
sha256 cellar: :any_skip_relocation, monterey: "6515f4b7b946956c5e0b2e7408df2c78fa45bd58ea3de9ed835b6db8be8e94bf"
|
|
sha256 cellar: :any_skip_relocation, big_sur: "b16de7940318bd8216accf38bdb179d53f6c2d91f98f6a5fd4d8dde803ecd9e1"
|
|
sha256 cellar: :any_skip_relocation, catalina: "19902896ee7f4ba3554b3046f7c669c321c5f076086516dbab77fc6a7af51872"
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "7a70ff5014b0d73e9eaa2bb1ee440976b766d69a84fb39737a6fffaff3dd942e"
|
|
end
|
|
|
|
depends_on "python@3.10"
|
|
depends_on "pyyaml"
|
|
|
|
resource "gitdb" do
|
|
url "https://files.pythonhosted.org/packages/fc/44/64e02ef96f20b347385f0e9c03098659cb5a1285d36c3d17c56e534d80cf/gitdb-4.0.9.tar.gz"
|
|
sha256 "bac2fd45c0a1c9cf619e63a90d62bdc63892ef92387424b855792a6cabe789aa"
|
|
end
|
|
|
|
resource "GitPython" do
|
|
url "https://files.pythonhosted.org/packages/d6/39/5b91b6c40570dc1c753359de7492404ba8fe7d71af40b618a780c7ad1fc7/GitPython-3.1.27.tar.gz"
|
|
sha256 "1c885ce809e8ba2d88a29befeb385fcea06338d3640712b59ca623c220bb5704"
|
|
end
|
|
|
|
resource "pbr" do
|
|
url "https://files.pythonhosted.org/packages/51/da/eb358ed53257a864bf9deafba25bc3d6b8d41b0db46da4e7317500b1c9a5/pbr-5.8.1.tar.gz"
|
|
sha256 "66bc5a34912f408bb3925bf21231cb6f59206267b7f63f3503ef865c1a292e25"
|
|
end
|
|
|
|
resource "smmap" do
|
|
url "https://files.pythonhosted.org/packages/21/2d/39c6c57032f786f1965022563eec60623bb3e1409ade6ad834ff703724f3/smmap-5.0.0.tar.gz"
|
|
sha256 "c840e62059cd3be204b0c9c9f74be2c09d5648eddd4580d9314c3ecde0b30936"
|
|
end
|
|
|
|
resource "stevedore" do
|
|
url "https://files.pythonhosted.org/packages/67/73/cd693fde78c3b2397d49ad2c6cdb082eb0b6a606188876d61f53bae16293/stevedore-3.5.0.tar.gz"
|
|
sha256 "f40253887d8712eaa2bb0ea3830374416736dc8ec0e22f5a65092c1174c44335"
|
|
end
|
|
|
|
def install
|
|
virtualenv_install_with_resources
|
|
end
|
|
|
|
test do
|
|
(testpath/"test.py").write "assert True\n"
|
|
output = JSON.parse shell_output("#{bin}/bandit -q -f json test.py", 1)
|
|
assert_equal output["results"][0]["test_id"], "B101"
|
|
end
|
|
end
|