Skip to content

Commit b07ab5a

Browse files
authored
Asciidoctor: Freeze constants (#632)
Freezes all of the variables that have CONSTANT_CASE so we don't accidentally mutate them and enables rubocop enforcement for this.
1 parent ccc160c commit b07ab5a

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

resources/asciidoctor/.rubocop.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ Metrics/PerceivedComplexity:
5757
Style/HashSyntax:
5858
Enabled: false
5959

60-
Style/MutableConstant:
61-
Enabled: false
62-
6360
Style/NestedParenthesizedCalls:
6461
Enabled: false
6562

resources/asciidoctor/lib/copy_images/extension.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class CopyImages < TreeProcessorScaffold
2424
'added' => 'note',
2525
'changed' => 'note',
2626
'deleted' => 'warning',
27-
}
27+
}.freeze
2828

2929
def initialize(name)
3030
super

resources/asciidoctor/lib/elastic_compat_preprocessor/extension.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@
9292
class ElasticCompatPreprocessor < Asciidoctor::Extensions::Preprocessor
9393
include Asciidoctor::Logging
9494

95-
INCLUDE_TAGGED_DIRECTIVE_RX = /^include-tagged::([^\[][^\[]*)\[(#{Asciidoctor::CC_ANY}+)?\]$/
96-
SOURCE_WITH_SUBS_RX = /^\["source", ?"[^"]+", ?subs="(#{Asciidoctor::CC_ANY}+)"\]$/
97-
CODE_BLOCK_RX = /^-----*$/
95+
INCLUDE_TAGGED_DIRECTIVE_RX = /^include-tagged::([^\[][^\[]*)\[(#{Asciidoctor::CC_ANY}+)?\]$/.freeze
96+
SOURCE_WITH_SUBS_RX = /^\["source", ?"[^"]+", ?subs="(#{Asciidoctor::CC_ANY}+)"\]$/.freeze
97+
CODE_BLOCK_RX = /^-----*$/.freeze
9898

9999
def process(_document, reader)
100100
reader.instance_variable_set :@in_attribute_only_block, false

0 commit comments

Comments
 (0)