Skip to content

Commit b09ca83

Browse files
committed
(PUP-11993) Style/PercentQLiterals
This commit enables the Style/PercentQLiterals cop and fixes 3 autcorrectable offenses.
1 parent 4bdc8e2 commit b09ca83

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -640,14 +640,6 @@ Style/NumericPredicate:
640640
Style/OptionalBooleanParameter:
641641
Enabled: false
642642

643-
# This cop supports safe auto-correction (--auto-correct).
644-
# Configuration parameters: EnforcedStyle.
645-
# SupportedStyles: lower_case_q, upper_case_q
646-
Style/PercentQLiterals:
647-
Exclude:
648-
- 'lib/puppet/provider/package/dpkg.rb'
649-
- 'lib/puppet/provider/package/rpm.rb'
650-
651643
# This cop supports safe auto-correction (--auto-correct).
652644
Style/PerlBackrefs:
653645
Enabled: false

lib/puppet/provider/package/dpkg.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ def self.instances
4545

4646
# Note: self:: is required here to keep these constants in the context of what will
4747
# eventually become this Puppet::Type::Package::ProviderDpkg class.
48-
self::DPKG_QUERY_FORMAT_STRING = %Q('${Status} ${Package} ${Version}\\n')
49-
self::DPKG_QUERY_PROVIDES_FORMAT_STRING = %Q('${Status} ${Package} ${Version} [${Provides}]\\n')
48+
self::DPKG_QUERY_FORMAT_STRING = %q('${Status} ${Package} ${Version}\\n')
49+
self::DPKG_QUERY_PROVIDES_FORMAT_STRING = %q('${Status} ${Package} ${Version} [${Provides}]\\n')
5050
self::FIELDS_REGEX = %r{^'?(\S+) +(\S+) +(\S+) (\S+) (\S*)$}
5151
self::FIELDS_REGEX_WITH_PROVIDES = %r{^'?(\S+) +(\S+) +(\S+) (\S+) (\S*) \[.*\]$}
5252
self::FIELDS = [:desired, :error, :status, :name, :ensure]

lib/puppet/provider/package/rpm.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# Note: self:: is required here to keep these constants in the context of what will
2525
# eventually become this Puppet::Type::Package::ProviderRpm class.
2626
# The query format by which we identify installed packages
27-
self::NEVRA_FORMAT = %Q(%{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}\\n)
27+
self::NEVRA_FORMAT = %q(%{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}\\n)
2828
self::NEVRA_REGEX = %r{^'?(\S+) (\S+) (\S+) (\S+) (\S+)$}
2929
self::NEVRA_FIELDS = [:name, :epoch, :version, :release, :arch]
3030
self::MULTIVERSION_SEPARATOR = "; "

0 commit comments

Comments
 (0)