47 lines
1.6 KiB
Ruby
47 lines
1.6 KiB
Ruby
class Yamllint < Formula
|
|
include Language::Python::Virtualenv
|
|
|
|
desc "Linter for YAML files"
|
|
homepage "https://github.com/adrienverge/yamllint"
|
|
url "https://github.com/adrienverge/yamllint/archive/v1.12.1.tar.gz"
|
|
sha256 "63549d4b34bab8dc6b44edb256faac23a21c8ea3644fa6400e7f846f86b50b62"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "837180371393f00d0b5ede38763f09584d92d752544e48b4d2fdd96d2e04308f" => :mojave
|
|
sha256 "4bf5ea9e562ee2033d1d6c919f11d49d00c788556715b61aa4e46242e6738c7a" => :high_sierra
|
|
sha256 "4d45b67f7fabf823b836ed80b065196a3ce3e5def59759b7b2fff43acf10cc74" => :sierra
|
|
end
|
|
|
|
depends_on "libyaml"
|
|
depends_on "python"
|
|
|
|
resource "PyYAML" do
|
|
url "https://files.pythonhosted.org/packages/9e/a3/1d13970c3f36777c583f136c136f804d70f500168edc1edea6daa7200769/PyYAML-3.13.tar.gz"
|
|
sha256 "3ef3092145e9b70e3ddd2c7ad59bdd0252a94dfe3949721633e41344de00a6bf"
|
|
end
|
|
|
|
resource "pathspec" do
|
|
url "https://files.pythonhosted.org/packages/84/2a/bfee636b1e2f7d6e30dd74f49201ccfa5c3cf322d44929ecc6c137c486c5/pathspec-0.5.9.tar.gz"
|
|
sha256 "54a5eab895d89f342b52ba2bffe70930ef9f8d96e398cccf530d21fa0516a873"
|
|
end
|
|
|
|
def install
|
|
virtualenv_install_with_resources
|
|
end
|
|
|
|
test do
|
|
(testpath/"bad.yaml").write <<~EOS
|
|
---
|
|
foo: bar: gee
|
|
EOS
|
|
output = shell_output("#{bin}/yamllint -f parsable -s bad.yaml", 1)
|
|
assert_match "syntax error: mapping values are not allowed here", output
|
|
|
|
(testpath/"good.yaml").write <<~EOS
|
|
---
|
|
foo: bar
|
|
EOS
|
|
assert_equal "", shell_output("#{bin}/yamllint -f parsable -s good.yaml")
|
|
end
|
|
end
|