From 3fef250b96389e3ac3e96dabfc5272f542987b37 Mon Sep 17 00:00:00 2001 From: Oliver Newman Date: Sat, 23 Jun 2018 14:24:30 -0700 Subject: [PATCH 1/4] black 18.6b4 (new formula) --- Formula/black.rb | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Formula/black.rb diff --git a/Formula/black.rb b/Formula/black.rb new file mode 100644 index 00000000000000..d31bb0f8604021 --- /dev/null +++ b/Formula/black.rb @@ -0,0 +1,41 @@ +class Black < Formula + include Language::Python::Virtualenv + + desc "The uncompromising Python code formatter" + homepage "https://black.readthedocs.io/en/stable/" + url "https://files.pythonhosted.org/packages/2d/43/64205493cfb4c8e1720208d73502a121ace2a195cd4d1d49bd7470e4fd92/black-18.6b4.tar.gz" + sha256 "22158b89c1a6b4eb333a1e65e791a3f8b998cf3b11ae094adb2570f31f769a44" + + depends_on "python" + + resource "appdirs" do + url "https://files.pythonhosted.org/packages/48/69/d87c60746b393309ca30761f8e2b49473d43450b150cb08f3c6df5c11be5/appdirs-1.4.3.tar.gz" + sha256 "9e5896d1372858f8dd3344faf4e5014d21849c756c8d5701f78f8a103b372d92" + end + + resource "attrs" do + url "https://files.pythonhosted.org/packages/e4/ac/a04671e118b57bee87dabca1e0f2d3bda816b7a551036012d0ca24190e71/attrs-18.1.0.tar.gz" + sha256 "e0d0eb91441a3b53dab4d9b743eafc1ac44476296a2053b6ca3af0b139faf87b" + end + + resource "click" do + url "https://files.pythonhosted.org/packages/95/d9/c3336b6b5711c3ab9d1d3a80f1a3e2afeb9d8c02a7166462f6cc96570897/click-6.7.tar.gz" + sha256 "f15516df478d5a56180fbf80e68f206010e6d160fc39fa508b65e035fd75130b" + end + + resource "toml" do + url "https://files.pythonhosted.org/packages/f5/f9/044110c267e6408013b85166a7cfcd352cf85275aa8ce700aa5c0eb407ba/toml-0.9.4.tar.gz" + sha256 "8e86bd6ce8cc11b9620cb637466453d94f5d57ad86f17e98a98d1f73e3baab2d" + end + + def install + virtualenv_create(libexec, "python3") + virtualenv_install_with_resources + end + + test do + ENV["LC_ALL"] = "en_US.UTF-8" + (testpath/"black_test.py").write("print(\"It works!\")") + system bin/"black", "black_test.py" + end +end From 3ad585d1ef74ed8b661676e54cec3f91fe2d0e16 Mon Sep 17 00:00:00 2001 From: Oliver Newman Date: Mon, 25 Jun 2018 22:04:31 -0700 Subject: [PATCH 2/4] Improve test for black --- Formula/black.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Formula/black.rb b/Formula/black.rb index d31bb0f8604021..44859970bb3f69 100644 --- a/Formula/black.rb +++ b/Formula/black.rb @@ -35,7 +35,11 @@ def install test do ENV["LC_ALL"] = "en_US.UTF-8" - (testpath/"black_test.py").write("print(\"It works!\")") + (testpath/"black_test.py").write <<~EOS + print( + 'It works!') + EOS system bin/"black", "black_test.py" + assert_equal "print(\"It works!\")\n", (testpath/"black_test.py").read end end From 5f01953e697faaafd24e4729cca7e06d1adcf588 Mon Sep 17 00:00:00 2001 From: Oliver Newman Date: Sat, 7 Jul 2018 13:15:02 -0700 Subject: [PATCH 3/4] Remove unnecessary virtualenv command --- Formula/black.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/Formula/black.rb b/Formula/black.rb index 44859970bb3f69..39b4bd8b762a74 100644 --- a/Formula/black.rb +++ b/Formula/black.rb @@ -29,7 +29,6 @@ class Black < Formula end def install - virtualenv_create(libexec, "python3") virtualenv_install_with_resources end From a302351370da172623a08c9f25ab7e0713a8b2e0 Mon Sep 17 00:00:00 2001 From: Oliver Newman Date: Wed, 1 Aug 2018 22:11:45 -0700 Subject: [PATCH 4/4] Make description more factual --- Formula/black.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Formula/black.rb b/Formula/black.rb index 39b4bd8b762a74..dec7fd1687eb01 100644 --- a/Formula/black.rb +++ b/Formula/black.rb @@ -1,7 +1,7 @@ class Black < Formula include Language::Python::Virtualenv - desc "The uncompromising Python code formatter" + desc "Python code formatter" homepage "https://black.readthedocs.io/en/stable/" url "https://files.pythonhosted.org/packages/2d/43/64205493cfb4c8e1720208d73502a121ace2a195cd4d1d49bd7470e4fd92/black-18.6b4.tar.gz" sha256 "22158b89c1a6b4eb333a1e65e791a3f8b998cf3b11ae094adb2570f31f769a44"