From f212a0ca4663e72f1a4d846a64907c2f93b7c062 Mon Sep 17 00:00:00 2001 From: Pat Riehecky Date: Mon, 14 Sep 2020 10:16:33 -0500 Subject: [PATCH] Resolve puppet-lint --- manifests/versionlock.pp | 2 ++ types/rpmarch.pp | 25 ++++++++++++++++++++++++- types/versionlockstring.pp | 6 ++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/manifests/versionlock.pp b/manifests/versionlock.pp index 4f7e1403..28fe9434 100644 --- a/manifests/versionlock.pp +++ b/manifests/versionlock.pp @@ -69,7 +69,9 @@ if $facts['package_provider'] == 'yum' and $version =~ Undef { assert_type(Yum::VersionlockString, $name) |$_expected, $actual | { + # lint:ignore:140chars fail("Package name must be formatted as %{EPOCH}:%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}, not \'${actual}\'. See Yum::Versionlock documentation for details.") + # lint:endignore } $_versionlock = "${line_prefix}${name}" diff --git a/types/rpmarch.pp b/types/rpmarch.pp index a2f95ef0..1a37e548 100644 --- a/types/rpmarch.pp +++ b/types/rpmarch.pp @@ -1,4 +1,27 @@ # @summary Valid rpm architectures. # Output of `rpm -q --queryformat '%{arch}\n' package` # @see https://github.com/rpm-software-management/rpm/blob/master/rpmrc.in -type Yum::RpmArch = Enum['noarch', 'x86_64', 'i386', 'arm', 'ppc64', 'ppc64le', 'sparc64', 'ia64' ,'alpha' , 'ip' , 'm68k', 'mips', 'mipsel' , 'mk68k' , 'mint' , 'ppc', 'rs6000' , 's390', 's390x' , 'sh', 'sparc', 'xtensa'] +type Yum::RpmArch = Enum[ + 'noarch', + 'x86_64', + 'i386', + 'arm', + 'ppc64', + 'ppc64le', + 'sparc64', + 'ia64', + 'alpha', + 'ip', + 'm68k', + 'mips', + 'mipsel', + 'mk68k', + 'mint', + 'ppc', + 'rs6000', + 's390', + 's390x', + 'sh', + 'sparc', + 'xtensa', +] diff --git a/types/versionlockstring.pp b/types/versionlockstring.pp index 500075b7..44d234f6 100644 --- a/types/versionlockstring.pp +++ b/types/versionlockstring.pp @@ -15,8 +15,10 @@ # RELEASE: Any valid release string. Only limitation is that it is not a dash (`-`) # type Yum::PackageRelease = Regexp[/[^-]+/] # +# lint:ignore:140chars # ARCH: Matches a string such as `el7.x86_64`. This is actuall two sub-expressions. See below. # type Yum::PackageArch = Regexp[/([0-9a-zZ-Z_\*]+)(?:\.(noarch|x86_64|i386|arm|ppc64|ppc64le|sparc64|ia64|alpha|ip|m68k|mips|mipsel|mk68k|mint|ppc|rs6000|s390|s390x|sh|sparc|xtensa|\*))?/] +# lint:endignore # # The `%{ARCH}` sub-expression is composed of two sub-expressions # separated by a dot (`.`), where the second part is optional. The RPM @@ -26,8 +28,10 @@ # DistTag: Any string consiting of only letters, numbers, or an underscore, e.g., `el6`, `sl7`, or `fc24`. # type Yum::PackageDistTag = Regexp[/[0-9a-zZ-Z_\*]+/] # +# lint:ignore:140chars # BuildArch: Any string from the list at https://github.com/rpm-software-management/rpm/blob/master/rpmrc.in. Strings are roughly listed from most common to least common to improve performance. # type Yum::PackageBuildArch = Regexp[/noarch|x86_64|i386|arm|ppc64|ppc64le|sparc64|ia64|alpha|ip|m68k|mips|mipsel|mk68k|mint|ppc|rs6000|s390|s390x|sh|sparc|xtensa/] +# lint:endignore # # @note Each field may contain wildcard characters (`*`), but the # wildcard characters may not span the fields, may not cover the @@ -40,4 +44,6 @@ # @example An invalid string (wildcard spans the VERSION and RELEASE fields): `0:bash-4.*-el6.x86_64 # @example An invlaid string (wildcard spans the VERSION, RELEASE, and ARCH fields): `0:bash-*` # +# lint:ignore:140chars type Yum::VersionlockString = Pattern[/^([0-9\*]+):([0-9a-zA-Z\._\+%\{\}\*-]+)-([^-]+)-([^-]+)\.(([0-9a-zZ-Z_\*]+)(?:\.(noarch|x86_64|i386|arm|ppc64|ppc64le|sparc64|ia64|alpha|ip|m68k|mips|mipsel|mk68k|mint|ppc|rs6000|s390|s390x|sh|sparc|xtensa|\*))?)$/] +# lint:endignore