Fix `Style/MutableConstant` cop (#33602)
This commit is contained in:
		
							parent
							
								
									998cf0dd53
								
							
						
					
					
						commit
						3db8498903
					
				|  | @ -69,15 +69,6 @@ Style/MapToHash: | ||||||
|   Exclude: |   Exclude: | ||||||
|     - 'app/models/status.rb' |     - 'app/models/status.rb' | ||||||
| 
 | 
 | ||||||
| # This cop supports unsafe autocorrection (--autocorrect-all). |  | ||||||
| # Configuration parameters: EnforcedStyle. |  | ||||||
| # SupportedStyles: literals, strict |  | ||||||
| Style/MutableConstant: |  | ||||||
|   Exclude: |  | ||||||
|     - 'app/models/tag.rb' |  | ||||||
|     - 'app/services/delete_account_service.rb' |  | ||||||
|     - 'lib/mastodon/migration_warning.rb' |  | ||||||
| 
 |  | ||||||
| # Configuration parameters: AllowedMethods. | # Configuration parameters: AllowedMethods. | ||||||
| # AllowedMethods: respond_to_missing? | # AllowedMethods: respond_to_missing? | ||||||
| Style/OptionalBooleanParameter: | Style/OptionalBooleanParameter: | ||||||
|  |  | ||||||
|  | @ -35,11 +35,11 @@ class Tag < ApplicationRecord | ||||||
|   has_one :trend, class_name: 'TagTrend', inverse_of: :tag, dependent: :destroy |   has_one :trend, class_name: 'TagTrend', inverse_of: :tag, dependent: :destroy | ||||||
| 
 | 
 | ||||||
|   HASHTAG_SEPARATORS = "_\u00B7\u30FB\u200c" |   HASHTAG_SEPARATORS = "_\u00B7\u30FB\u200c" | ||||||
|   HASHTAG_FIRST_SEQUENCE_CHUNK_ONE = "[[:word:]_][[:word:]#{HASHTAG_SEPARATORS}]*[[:alpha:]#{HASHTAG_SEPARATORS}]" |   HASHTAG_FIRST_SEQUENCE_CHUNK_ONE = "[[:word:]_][[:word:]#{HASHTAG_SEPARATORS}]*[[:alpha:]#{HASHTAG_SEPARATORS}]".freeze | ||||||
|   HASHTAG_FIRST_SEQUENCE_CHUNK_TWO = "[[:word:]#{HASHTAG_SEPARATORS}]*[[:word:]_]" |   HASHTAG_FIRST_SEQUENCE_CHUNK_TWO = "[[:word:]#{HASHTAG_SEPARATORS}]*[[:word:]_]".freeze | ||||||
|   HASHTAG_FIRST_SEQUENCE = "(#{HASHTAG_FIRST_SEQUENCE_CHUNK_ONE}#{HASHTAG_FIRST_SEQUENCE_CHUNK_TWO})" |   HASHTAG_FIRST_SEQUENCE = "(#{HASHTAG_FIRST_SEQUENCE_CHUNK_ONE}#{HASHTAG_FIRST_SEQUENCE_CHUNK_TWO})".freeze | ||||||
|   HASHTAG_LAST_SEQUENCE = '([[:word:]_]*[[:alpha:]][[:word:]_]*)' |   HASHTAG_LAST_SEQUENCE = '([[:word:]_]*[[:alpha:]][[:word:]_]*)' | ||||||
|   HASHTAG_NAME_PAT = "#{HASHTAG_FIRST_SEQUENCE}|#{HASHTAG_LAST_SEQUENCE}" |   HASHTAG_NAME_PAT = "#{HASHTAG_FIRST_SEQUENCE}|#{HASHTAG_LAST_SEQUENCE}".freeze | ||||||
| 
 | 
 | ||||||
|   HASHTAG_RE = %r{(?<![=/)\p{Alnum}])#(#{HASHTAG_NAME_PAT})} |   HASHTAG_RE = %r{(?<![=/)\p{Alnum}])#(#{HASHTAG_NAME_PAT})} | ||||||
|   HASHTAG_NAME_RE = /\A(#{HASHTAG_NAME_PAT})\z/i |   HASHTAG_NAME_RE = /\A(#{HASHTAG_NAME_PAT})\z/i | ||||||
|  |  | ||||||
|  | @ -51,7 +51,7 @@ class DeleteAccountService < BaseService | ||||||
|     scheduled_statuses |     scheduled_statuses | ||||||
|     status_pins |     status_pins | ||||||
|     tag_follows |     tag_follows | ||||||
|   ) |   ).freeze | ||||||
| 
 | 
 | ||||||
|   ASSOCIATIONS_ON_DESTROY = %w( |   ASSOCIATIONS_ON_DESTROY = %w( | ||||||
|     reports |     reports | ||||||
|  |  | ||||||
|  | @ -4,7 +4,7 @@ module Mastodon | ||||||
|   module MigrationWarning |   module MigrationWarning | ||||||
|     WARNING_SECONDS = 10 |     WARNING_SECONDS = 10 | ||||||
| 
 | 
 | ||||||
|     DEFAULT_WARNING = <<~WARNING_MESSAGE |     DEFAULT_WARNING = <<~WARNING_MESSAGE.freeze | ||||||
|       WARNING: This migration may take a *long* time for large instances. |       WARNING: This migration may take a *long* time for large instances. | ||||||
|       It will *not* lock tables for any significant time, but it may run |       It will *not* lock tables for any significant time, but it may run | ||||||
|       for a very long time. We will pause for #{WARNING_SECONDS} seconds to allow you to |       for a very long time. We will pause for #{WARNING_SECONDS} seconds to allow you to | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue