Skip to content

Commit

Permalink
Style/MutableConstant-20240214233121 (#916)
Browse files Browse the repository at this point in the history
* 🚓 regenerate rubocop todo

* 🚓 Style/MutableConstant

* 🚓 regenerate rubocop todo

---------

Co-authored-by: Rubocop Challenger <[email protected]>
Co-authored-by: Mathieu Jobin <[email protected]>
  • Loading branch information
3 people authored May 30, 2024
1 parent 26a2807 commit 623a4d6
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 20 deletions.
13 changes: 0 additions & 13 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1660,19 +1660,6 @@ Style/MultilineBlockChain:
Exclude:
- 'lib/apipie/param_description.rb'

# Offense count: 7
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: literals, strict
Style/MutableConstant:
Exclude:
- 'lib/apipie/extractor/recorder.rb'
- 'lib/apipie/generator/swagger/param_description/in.rb'
- 'lib/apipie/generator/swagger/type_extractor.rb'
- 'lib/apipie/generator/swagger/warning.rb'
- 'lib/apipie/routes_formatter.rb'
- 'lib/apipie/version.rb'

# Offense count: 8
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
Expand Down
2 changes: 1 addition & 1 deletion lib/apipie/extractor/recorder.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Apipie
module Extractor
class Recorder
MULTIPART_BOUNDARY = 'APIPIE_RECORDER_EXAMPLE_BOUNDARY'
MULTIPART_BOUNDARY = 'APIPIE_RECORDER_EXAMPLE_BOUNDARY'.freeze

def initialize
@ignored_params = [:controller, :action]
Expand Down
2 changes: 1 addition & 1 deletion lib/apipie/generator/swagger/param_description/in.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class Apipie::Generator::Swagger::ParamDescription::In
IN_KEYWORD_DEFAULT_VALUES = {
form_data: 'formData',
query: 'query'
}
}.freeze

def initialize(param_description, in_schema:, default_in_value:, http_method:)
@param_description = param_description
Expand Down
2 changes: 1 addition & 1 deletion lib/apipie/generator/swagger/type_extractor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Apipie::Generator::Swagger::TypeExtractor
date: Apipie::Generator::Swagger::Type.new('string', 'date'),
dateTime: Apipie::Generator::Swagger::Type.new('string', 'date-time'),
password: Apipie::Generator::Swagger::Type.new('string', 'password')
}
}.freeze

# @param [Apipie::Validator::BaseValidator, ResponseDescriptionAdapter::PropDesc::Validator, nil] validator
def initialize(validator)
Expand Down
4 changes: 2 additions & 2 deletions lib/apipie/generator/swagger/warning.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Apipie::Generator::Swagger::Warning
optional_without_default_value: OPTIONAL_WITHOUT_DEFAULT_VALUE_CODE,
param_ignored_in_form_data: PARAM_IGNORED_IN_FORM_DATA_CODE,
path_param_not_described_code: PATH_PARAM_NOT_DESCRIBED_CODE
}
}.freeze

MESSAGES = {
MISSING_METHOD_SUMMARY_CODE => "Missing short description for method",
Expand All @@ -28,7 +28,7 @@ class Apipie::Generator::Swagger::Warning
OPTIONAL_WITHOUT_DEFAULT_VALUE_CODE => "The parameter :%{parameter} is optional but default value is not specified (use :default_value => ...)",
PARAM_IGNORED_IN_FORM_DATA_CODE => "Ignoring param :%{parameter} -- cannot include Hash without fields in a formData specification",
PATH_PARAM_NOT_DESCRIBED_CODE => "The parameter :%{name} appears in the path %{path} but is not described"
}
}.freeze

attr_reader :code

Expand Down
2 changes: 1 addition & 1 deletion lib/apipie/routes_formatter.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Apipie
class RoutesFormatter
API_METHODS = %w{GET POST PUT PATCH OPTIONS DELETE}
API_METHODS = %w{GET POST PUT PATCH OPTIONS DELETE}.freeze

# The entry method called by Apipie to extract the array
# representing the api dsl from the routes definition.
Expand Down
2 changes: 1 addition & 1 deletion lib/apipie/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Apipie
VERSION = "1.4.0"
VERSION = "1.4.1".freeze
end

0 comments on commit 623a4d6

Please sign in to comment.