homebrew-core/Formula/commitizen.rb

109 lines
5.3 KiB
Ruby

class Commitizen < Formula
include Language::Python::Virtualenv
desc "Defines a standard way of committing rules and communicating it"
homepage "https://commitizen-tools.github.io/commitizen/"
url "https://files.pythonhosted.org/packages/6c/00/9f7b3835b500b3563d200eb38509205f7859ef793f0a70c9538f0123727f/commitizen-2.37.1.tar.gz"
sha256 "933b7f781d22e9f76b0ff3164aa13045bf36df3d07140219f21b3e7e05e54151"
license "MIT"
head "https://github.com/commitizen-tools/commitizen.git", branch: "master"
bottle do
sha256 cellar: :any_skip_relocation, arm64_ventura: "ded484ce4a40fd1442e09c0e9888914d290e7361d37ebcb5b9fbadf5cd0bc023"
sha256 cellar: :any_skip_relocation, arm64_monterey: "3bd20b512092a26cf78222d08ae008ebbe43504c58474c55d78079f091c495e5"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "c0d7b352ea6ba30ea9bea511aebe9197430a6f4a86abc6fd6a9228b63ead27a2"
sha256 cellar: :any_skip_relocation, ventura: "1a8ee0840eb1d368d7922a74c01050a87b8e4283f03fb67a23a65700bf45b280"
sha256 cellar: :any_skip_relocation, monterey: "d3b36bee8dff544b7f0cc385df7416f8d31d3dc87ac3f45a0ce0d15b3ba9ca6e"
sha256 cellar: :any_skip_relocation, big_sur: "5a4a24a800fd25a22f6d58d8465d4132bcd4c22ddea068978d060ed35122de0c"
sha256 cellar: :any_skip_relocation, catalina: "b7bdf5c6316e27ee271d19744a7563f772e69999fc844618740788966443fd7d"
sha256 cellar: :any_skip_relocation, x86_64_linux: "cf18eccce13cd81febf8c83b8e8f93223d3e059724a86c0302212e19b81f3209"
end
depends_on "python-typing-extensions"
depends_on "python@3.11"
depends_on "pyyaml"
resource "argcomplete" do
url "https://files.pythonhosted.org/packages/05/f8/67851ae4fe5396ba6868c5d84219b81ea6a5d53991a6853616095c30adc0/argcomplete-2.0.0.tar.gz"
sha256 "6372ad78c89d662035101418ae253668445b391755cfe94ea52f1b9d22425b20"
end
resource "charset-normalizer" do
url "https://files.pythonhosted.org/packages/a1/34/44964211e5410b051e4b8d2869c470ae8a68ae274953b1c7de6d98bbcf94/charset-normalizer-2.1.1.tar.gz"
sha256 "5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845"
end
resource "colorama" do
url "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz"
sha256 "08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"
end
resource "decli" do
url "https://files.pythonhosted.org/packages/9f/30/064f53ca7b75c33a892dcc4230f78a1e01bee4b5b9b49c0be1a61601c9bd/decli-0.5.2.tar.gz"
sha256 "f2cde55034a75c819c630c7655a844c612f2598c42c21299160465df6ad463ad"
end
resource "Jinja2" do
url "https://files.pythonhosted.org/packages/7a/ff/75c28576a1d900e87eb6335b063fab47a8ef3c8b4d88524c4bf78f670cce/Jinja2-3.1.2.tar.gz"
sha256 "31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852"
end
resource "MarkupSafe" do
url "https://files.pythonhosted.org/packages/1d/97/2288fe498044284f39ab8950703e88abbac2abbdf65524d576157af70556/MarkupSafe-2.1.1.tar.gz"
sha256 "7f91197cc9e48f989d12e4e6fbc46495c446636dfc81b9ccf50bb0ec74b91d4b"
end
resource "packaging" do
url "https://files.pythonhosted.org/packages/df/9e/d1a7217f69310c1db8fdf8ab396229f55a699ce34a203691794c5d1cad0c/packaging-21.3.tar.gz"
sha256 "dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb"
end
resource "prompt-toolkit" do
url "https://files.pythonhosted.org/packages/c4/6e/6ff7938f47981305a801a4c5b8d8ed282b58a28c01c394d43c1fbcfc810b/prompt_toolkit-3.0.33.tar.gz"
sha256 "535c29c31216c77302877d5120aef6c94ff573748a5b5ca5b1b1f76f5e700c73"
end
resource "pyparsing" do
url "https://files.pythonhosted.org/packages/71/22/207523d16464c40a0310d2d4d8926daffa00ac1f5b1576170a32db749636/pyparsing-3.0.9.tar.gz"
sha256 "2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb"
end
resource "questionary" do
url "https://files.pythonhosted.org/packages/04/c6/a8dbf1edcbc236d93348f6e7c437cf09c7356dd27119fcc3be9d70c93bb1/questionary-1.10.0.tar.gz"
sha256 "600d3aefecce26d48d97eee936fdb66e4bc27f934c3ab6dd1e292c4f43946d90"
end
resource "termcolor" do
url "https://files.pythonhosted.org/packages/19/da/ff1f0906818a5bd2e69e773d88801ca3c9e92d0d7caa99db1665658819ea/termcolor-2.1.1.tar.gz"
sha256 "67cee2009adc6449c650f6bcf3bdeed00c8ba53a8cda5362733c53e0a39fb70b"
end
resource "tomlkit" do
url "https://files.pythonhosted.org/packages/ff/04/58b4c11430ed4b7b8f1723a5e4f20929d59361e9b17f0872d69681fd8ffd/tomlkit-0.11.6.tar.gz"
sha256 "71b952e5721688937fb02cf9d354dbcf0785066149d2855e44531ebdd2b65d73"
end
resource "wcwidth" do
url "https://files.pythonhosted.org/packages/89/38/459b727c381504f361832b9e5ace19966de1a235d73cdbdea91c771a1155/wcwidth-0.2.5.tar.gz"
sha256 "c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83"
end
def install
virtualenv_install_with_resources
end
test do
# Generates a changelog after an example commit
system "git", "init"
touch "example"
system "git", "add", "example"
system "yes | #{bin}/cz commit"
system "#{bin}/cz", "changelog"
# Verifies the checksum of the changelog
expected_sha = "97da642d3cb254dbfea23a9405fb2b214f7788c8ef0c987bc0cde83cca46f075"
output = File.read(testpath/"CHANGELOG.md")
assert_match Digest::SHA256.hexdigest(output), expected_sha
end
end