119 lines
5.5 KiB
Ruby
119 lines
5.5 KiB
Ruby
class CfnLint < Formula
|
|
include Language::Python::Virtualenv
|
|
|
|
desc "Validate CloudFormation templates against the CloudFormation spec"
|
|
homepage "https://github.com/aws-cloudformation/cfn-python-lint/"
|
|
url "https://files.pythonhosted.org/packages/4f/d3/912a98e6022fffd47850da8ba0bb86da2f8e289ed4dcf31a8bcd96bd784f/cfn-lint-0.54.3.tar.gz"
|
|
sha256 "9155b0eb876f746095708d5eda80264efa4872a0586e4d613197a54eeca95e40"
|
|
license "MIT-0"
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, arm64_monterey: "50073c2682865b7432d59b26004269a09e0c22a9e72effa17d286b94be739bcd"
|
|
sha256 cellar: :any_skip_relocation, arm64_big_sur: "49289cb06f810a8d3529bfac2794fa680ca594bdcd390284fcadab232f3e36db"
|
|
sha256 cellar: :any_skip_relocation, monterey: "c1b669227a62c447a56e542423a1cea63a9430284bd504a25149f1b36d50ed1c"
|
|
sha256 cellar: :any_skip_relocation, big_sur: "659b508f67b44221371b76ec584575dd3428c8645601f9bd958fbe6317c896e5"
|
|
sha256 cellar: :any_skip_relocation, catalina: "f3b5264daed35d130e5ce3402d5c6ed02324aa2a4d5a41658fa2ed273d03403f"
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "fd7afc781f25a6b5d31d357f986dd34fa5daa53b0c73bad170dc2421835b663e"
|
|
end
|
|
|
|
depends_on "python@3.10"
|
|
depends_on "six"
|
|
|
|
resource "attrs" do
|
|
url "https://files.pythonhosted.org/packages/ed/d6/3ebca4ca65157c12bd08a63e20ac0bdc21ac7f3694040711f9fd073c0ffb/attrs-21.2.0.tar.gz"
|
|
sha256 "ef6aaac3ca6cd92904cdd0d83f629a15f18053ec84e6432106f7a4d04ae4f5fb"
|
|
end
|
|
|
|
resource "aws-sam-translator" do
|
|
url "https://files.pythonhosted.org/packages/06/16/20e660646b3b81d721973d409a64898c0c569dcd14221041098e7d2680bf/aws-sam-translator-1.39.0.tar.gz"
|
|
sha256 "8973af434ef649861b03a104581b64c219fcf255adb7510e71a6e96914be3208"
|
|
end
|
|
|
|
resource "boto3" do
|
|
url "https://files.pythonhosted.org/packages/ec/45/d12f9c09b5c4dad8bcb098dfae5e9e1253ed6408efbbd9a3e60bff55b824/boto3-1.19.2.tar.gz"
|
|
sha256 "11a6035060230e92327d4f10fef6bc44188b2cd68504012bc25ed62ac31d670b"
|
|
end
|
|
|
|
resource "botocore" do
|
|
url "https://files.pythonhosted.org/packages/0d/95/f2e74e4a91994d9ebe45746f75a8c5cafd723a88270a9772d8d66e1a8ba1/botocore-1.22.2.tar.gz"
|
|
sha256 "011360e79a4b843aa6591573cfa61e8eddc99b91adab1dfdb9a2b7f2c8511193"
|
|
end
|
|
|
|
resource "jmespath" do
|
|
url "https://files.pythonhosted.org/packages/3c/56/3f325b1eef9791759784aa5046a8f6a1aff8f7c898a2e34506771d3b99d8/jmespath-0.10.0.tar.gz"
|
|
sha256 "b85d0567b8666149a93172712e68920734333c0ce7e89b78b3e987f71e5ed4f9"
|
|
end
|
|
|
|
resource "jsonpatch" do
|
|
url "https://files.pythonhosted.org/packages/21/67/83452af2a6db7c4596d1e2ecaa841b9a900980103013b867f2865e5e1cf0/jsonpatch-1.32.tar.gz"
|
|
sha256 "b6ddfe6c3db30d81a96aaeceb6baf916094ffa23d7dd5fa2c13e13f8b6e600c2"
|
|
end
|
|
|
|
resource "jsonpointer" do
|
|
url "https://files.pythonhosted.org/packages/6b/35/400557d3df63269a4c010cbd4865910b3c1718fbfe8d83210b216cd3efcf/jsonpointer-2.1.tar.gz"
|
|
sha256 "5a34b698db1eb79ceac454159d3f7c12a451a91f6334a4f638454327b7a89962"
|
|
end
|
|
|
|
resource "jsonschema" do
|
|
url "https://files.pythonhosted.org/packages/69/11/a69e2a3c01b324a77d3a7c0570faa372e8448b666300c4117a516f8b1212/jsonschema-3.2.0.tar.gz"
|
|
sha256 "c8a85b28d377cc7737e46e2d9f2b4f44ee3c0e1deac6bf46ddefc7187d30797a"
|
|
end
|
|
|
|
# only doing this because junit-xml source is not available in PyPI for v1.9
|
|
resource "junit-xml" do
|
|
url "https://github.com/kyrus/python-junit-xml.git",
|
|
revision: "4bd08a272f059998cedf9b7779f944d49eba13a6"
|
|
end
|
|
|
|
resource "networkx" do
|
|
url "https://files.pythonhosted.org/packages/97/ae/7497bc5e1c84af95e585e3f98585c9f06c627fac6340984c4243053e8f44/networkx-2.6.3.tar.gz"
|
|
sha256 "c0946ed31d71f1b732b5aaa6da5a0388a345019af232ce2f49c766e2d6795c51"
|
|
end
|
|
|
|
resource "pyrsistent" do
|
|
url "https://files.pythonhosted.org/packages/f4/d7/0fa558c4fb00f15aabc6d42d365fcca7a15fcc1091cd0f5784a14f390b7f/pyrsistent-0.18.0.tar.gz"
|
|
sha256 "773c781216f8c2900b42a7b638d5b517bb134ae1acbebe4d1e8f1f41ea60eb4b"
|
|
end
|
|
|
|
resource "python-dateutil" do
|
|
url "https://files.pythonhosted.org/packages/4c/c4/13b4776ea2d76c115c1d1b84579f3764ee6d57204f6be27119f13a61d0a9/python-dateutil-2.8.2.tar.gz"
|
|
sha256 "0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"
|
|
end
|
|
|
|
resource "PyYAML" do
|
|
url "https://files.pythonhosted.org/packages/36/2b/61d51a2c4f25ef062ae3f74576b01638bebad5e045f747ff12643df63844/PyYAML-6.0.tar.gz"
|
|
sha256 "68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2"
|
|
end
|
|
|
|
resource "s3transfer" do
|
|
url "https://files.pythonhosted.org/packages/88/ef/4d1b3f52ae20a7e72151fde5c9f254cd83f8a49047351f34006e517e1655/s3transfer-0.5.0.tar.gz"
|
|
sha256 "50ed823e1dc5868ad40c8dc92072f757aa0e653a192845c94a3b676f4a62da4c"
|
|
end
|
|
|
|
resource "urllib3" do
|
|
url "https://files.pythonhosted.org/packages/80/be/3ee43b6c5757cabea19e75b8f46eaf05a2f5144107d7db48c7cf3a864f73/urllib3-1.26.7.tar.gz"
|
|
sha256 "4987c65554f7a2dbf30c18fd48778ef124af6fab771a377103da0585e2336ece"
|
|
end
|
|
|
|
def install
|
|
virtualenv_install_with_resources
|
|
end
|
|
|
|
test do
|
|
(testpath/"test.yml").write <<~EOS
|
|
---
|
|
AWSTemplateFormatVersion: '2010-09-09'
|
|
Resources:
|
|
# Helps tests map resource types
|
|
IamPipeline:
|
|
Type: "AWS::CloudFormation::Stack"
|
|
Properties:
|
|
TemplateURL: !Sub 'https://s3.${AWS::Region}.amazonaws.com/bucket-dne-${AWS::Region}/${AWS::AccountId}/pipeline.yaml'
|
|
Parameters:
|
|
DeploymentName: iam-pipeline
|
|
Deploy: 'auto'
|
|
EOS
|
|
system bin/"cfn-lint", "test.yml"
|
|
end
|
|
end
|