Skip to content

Commit fedc008

Browse files
author
Alexander Salmin
committed
Improve syntax
1 parent 731716c commit fedc008

23 files changed

+25
-24
lines changed

spec/fixtures/test/manifests/absolute_path.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
class test::absolute_path(
33
Stdlib::Compat::Absolute_path $value,
44
) {
5-
notice("Success")
5+
notice('Success')
66
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Class to test the Stdlib::Absolutepath type. Not to be confused with Stdlib::Compat::Absolute_path.
1+
# Class to test the Stdlib::Absolutepath type. Not to be confused with Stdlib::Compat::Absolute_path
22
class test::absolutepath(
33
Stdlib::Absolutepath $value,
44
) {
5-
notice("Success")
5+
notice('Success')
66
}

spec/fixtures/test/manifests/array.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
Stdlib::Compat::Array $value,
44
) {
55

6-
notice("Success")
6+
notice('Success')
77

88
}

spec/fixtures/test/manifests/bool.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
Stdlib::Compat::Bool $value,
44
) {
55

6-
notice("Success")
6+
notice('Success')
77

88
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Class to test deftype
12
define test::deftype($param = 'foo') {
2-
notify { "deftype: $title": }
3+
notify { "deftype: ${title}": }
34
}

spec/fixtures/test/manifests/filemode.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
class test::filemode (
33
Stdlib::Filemode $value,
44
) {
5-
notice("Success")
5+
notice('Success')
66
}

spec/fixtures/test/manifests/float.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
Stdlib::Compat::Float $value,
44
) {
55

6-
notice("Success")
6+
notice('Success')
77

88
}

spec/fixtures/test/manifests/hash.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
Stdlib::Compat::Hash $value,
44
) {
55

6-
notice("Success")
6+
notice('Success')
77

88
}

spec/fixtures/test/manifests/httpsurl.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
class test::httpsurl(
33
Stdlib::HTTPSUrl $value,
44
) {
5-
notice("Success")
5+
notice('Success')
66
}

spec/fixtures/test/manifests/httpurl.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
class test::httpurl(
33
Stdlib::HTTPUrl $value,
44
) {
5-
notice("Success")
5+
notice('Success')
66
}

spec/fixtures/test/manifests/integer.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
Stdlib::Compat::Integer $value,
44
) {
55

6-
notice("Success")
6+
notice('Success')
77

88
}

spec/fixtures/test/manifests/ip_address.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
class test::ip_address(
33
Stdlib::Compat::Ip_address $value,
44
) {
5-
notice("Success")
5+
notice('Success')
66
}

spec/fixtures/test/manifests/ipv4.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
class test::ipv4(
33
Stdlib::Compat::Ipv4 $value,
44
) {
5-
notice("Success")
5+
notice('Success')
66
}

spec/fixtures/test/manifests/ipv6.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
class test::ipv6(
33
Stdlib::Compat::Ipv6 $value,
44
) {
5-
notice("Success")
5+
notice('Success')
66
}

spec/fixtures/test/manifests/numeric.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
Stdlib::Compat::Numeric $value,
44
) {
55

6-
notice("Success")
6+
notice('Success')
77

88
}

spec/fixtures/test/manifests/string.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
Stdlib::Compat::String $value,
44
) {
55

6-
notice("Success")
6+
notice('Success')
77

88
}

spec/fixtures/test/manifests/unixpath.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
class test::unixpath(
33
Stdlib::Unixpath $value,
44
) {
5-
notice("Success")
5+
notice('Success')
66
}

spec/fixtures/test/manifests/windowspath.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
class test::windowspath(
33
Stdlib::Windowspath $value,
44
) {
5-
notice("Success")
5+
notice('Success')
66
}

types/compat/absolute_path.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# slash = '[\\\\/]'
55
# name = '[^\\\\/]+'
66
# %r!^(([A-Z]:#{slash})|(#{slash}#{slash}#{name}#{slash}#{name})|(#{slash}#{slash}\?#{slash}#{name}))!i,
7-
type Stdlib::Compat::Absolute_path = Variant[Pattern[/^(([a-zA-Z]:[\\\/])|([\\\/][\\\/][^\\\/]+[\\\/][^\\\/]+)|([\\\/][\\\/]\?[\\\/][^\\\/]+))/], Pattern[/^\//]]
7+
type Stdlib::Compat::Absolute_path = Variant[Pattern[/^(([a-zA-Z]:[\\\/])|([\\\/][\\\/][^\\\/]+[\\\/][^\\\/]+)|([\\\/][\\\/]\?[\\\/][^\\\/]+))/], Pattern[/^\//]] # lint:ignore:140chars

types/compat/integer.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
# > Note that you need to use Variant[Integer[0, 10], Float[0, 10]] if you want to match both integers and floating point numbers.
2121
#
2222
# This allows you to find all places where a consumers of your code call it with unexpected values.
23-
type Stdlib::Compat::Integer = Variant[Integer, Pattern[/^-?(?:(?:[1-9]\d*)|0)$/], Array[Variant[Integer, Pattern[/^-?(?:(?:[1-9]\d*)|0)$/]]]]
23+
type Stdlib::Compat::Integer = Variant[Integer, Pattern[/^-?(?:(?:[1-9]\d*)|0)$/], Array[Variant[Integer, Pattern[/^-?(?:(?:[1-9]\d*)|0)$/]]]] # lint:ignore:140chars

types/compat/ipv4.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Emulate the validate_ipv4_address and is_ipv4_address functions
2-
type Stdlib::Compat::Ipv4 = Pattern[/^((([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d))[.]){3}([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d)))(\/((([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d))[.]){3}([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d))|[0-9]+))?$/]
2+
type Stdlib::Compat::Ipv4 = Pattern[/^((([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d))[.]){3}([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d)))(\/((([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d))[.]){3}([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d))|[0-9]+))?$/] # lint:ignore:140chars

types/compat/ipv6.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line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.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/] # lint:ignore:140chars

types/compat/numeric.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
# > Note that you need to use Variant[Integer[0, 10], Float[0, 10]] if you want to match both integers and floating point numbers.
2121
#
2222
# This allows you to find all places where a consumers of your code call it with unexpected values.
23-
type Stdlib::Compat::Numeric = Variant[Numeric, Pattern[/^-?(?:(?:[1-9]\d*)|0)(?:\.\d+)?(?:[eE]-?\d+)?$/], Array[Variant[Numeric, Pattern[/^-?(?:(?:[1-9]\d*)|0)(?:\.\d+)?(?:[eE]-?\d+)?$/]]]]
23+
type Stdlib::Compat::Numeric = Variant[Numeric, Pattern[/^-?(?:(?:[1-9]\d*)|0)(?:\.\d+)?(?:[eE]-?\d+)?$/], Array[Variant[Numeric, Pattern[/^-?(?:(?:[1-9]\d*)|0)(?:\.\d+)?(?:[eE]-?\d+)?$/]]]] # lint:ignore:140chars

0 commit comments

Comments
 (0)