homebrew-core/Formula/commitizen.rb

103 lines
4.9 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/f9/a1/29b6efbf910722f173b77546296f5a131cf54e3a49823b23a7558a359994/commitizen-2.41.0.tar.gz"
sha256 "5d50093fe546cc3b5217780a8cdfc5a9de6a27ce8aa7db6443e2e47dc2b10b6a"
license "MIT"
head "https://github.com/commitizen-tools/commitizen.git", branch: "master"
bottle do
sha256 cellar: :any_skip_relocation, arm64_ventura: "5284f011c74ebbd94131c7ecfa3b65aed48904b3f6c945314800392e79c45e7f"
sha256 cellar: :any_skip_relocation, arm64_monterey: "f37cfee3766fb11145426478e2be505d84b690e2c2b8d878f029d49d62282353"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "191cebf7b389d1d254590f7e79ed46882ca7b366cf48a19a34a69b6b62a96b7c"
sha256 cellar: :any_skip_relocation, ventura: "39a2c42c4807580b33638b257416bf89eca3a4ee976b4a1e486681dc44b9dab0"
sha256 cellar: :any_skip_relocation, monterey: "84b0a66dded0b1862adf281f16be2077408f71fda125b20a9b1d857affc7f869"
sha256 cellar: :any_skip_relocation, big_sur: "a0dae7187be4c901eb05c354fe50beafc85d391d4355a4f3ce83cbfce95bc541"
sha256 cellar: :any_skip_relocation, x86_64_linux: "41e48dd863ab0d1578797a8a3334715816cf11e8192d9d449e511c65fe213cc7"
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/95/7e/68018b70268fb4a2a605e2be44ab7b4dd7ce7808adae6c5ef32e34f4b55a/MarkupSafe-2.1.2.tar.gz"
sha256 "abcabc8c2b26036d62d4c746381a6f7cf60aafcc653198ad678306986b09450d"
end
resource "packaging" do
url "https://files.pythonhosted.org/packages/47/d5/aca8ff6f49aa5565df1c826e7bf5e85a6df852ee063600c1efa5b932968c/packaging-23.0.tar.gz"
sha256 "b6ad297f8907de0fa2fe1ccbd26fdaf387f5f47c7275fedf8cce89f99446cf97"
end
resource "prompt-toolkit" do
url "https://files.pythonhosted.org/packages/fb/93/180be2342f89f16543ec4eb3f25083b5b84eba5378f68efff05409fb39a9/prompt_toolkit-3.0.36.tar.gz"
sha256 "3e163f254bef5a03b146397d7c1963bd3e2812f0964bb9a24e6ec761fd28db63"
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/e5/4e/b2a54a21092ad2d5d70b0140e4080811bee06a39cc8481651579fe865c89/termcolor-2.2.0.tar.gz"
sha256 "dfc8ac3f350788f23b2947b3e6cfa5a53b630b612e6cd8965a015a776020b99a"
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/5e/5f/1e4bd82a9cc1f17b2c2361a2d876d4c38973a997003ba5eb400e8a932b6c/wcwidth-0.2.6.tar.gz"
sha256 "a5220780a404dbe3353789870978e472cfe477761f06ee55077256e509b156d0"
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