Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fastlane action template warnings reported by Rubocop #21310

Merged
merged 5 commits into from
Jul 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 18 additions & 12 deletions fastlane/lib/assets/custom_action_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module SharedValues
class [[NAME_CLASS]] < Action
def self.run(params)
# fastlane will take care of reading in the parameter and fetching the environment variable:
UI.message "Parameter API Token: #{params[:api_token]}"
UI.message("Parameter API Token: #{params[:api_token]}")

# sh "shellcommand ./path"

Expand All @@ -19,13 +19,13 @@ def self.run(params)
#####################################################

def self.description
"A short description with <= 80 characters of what this action does"
'A short description with <= 80 characters of what this action does'
end

def self.details
# Optional:
# this is your chance to provide a more detailed description of this action
"You can use this action to do cool things..."
'You can use this action to do cool things...'
end

def self.available_options
Expand All @@ -34,17 +34,23 @@ def self.available_options
# Below a few examples
[
FastlaneCore::ConfigItem.new(key: :api_token,
env_name: "FL_[[NAME_UP]]_API_TOKEN", # The name of the environment variable
description: "API Token for [[NAME_CLASS]]", # a short description of this parameter
# The name of the environment variable
env_name: 'FL_[[NAME_UP]]_API_TOKEN',
# a short description of this parameter
description: 'API Token for [[NAME_CLASS]]',
verify_block: proc do |value|
UI.user_error!("No API token for [[NAME_CLASS]] given, pass using `api_token: 'token'`") unless (value and not value.empty?)
# UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
unless value && !value.empty?
UI.user_error!("No API token for [[NAME_CLASS]] given, pass using `api_token: 'token'`")
end
# UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
end),
FastlaneCore::ConfigItem.new(key: :development,
env_name: "FL_[[NAME_UP]]_DEVELOPMENT",
description: "Create a development certificate instead of a distribution one",
is_string: false, # true: verifies the input is a string, false: every kind of value
default_value: false) # the default value if the user didn't provide one
env_name: 'FL_[[NAME_UP]]_DEVELOPMENT',
description: 'Create a development certificate instead of a distribution one',
# true: verifies the input is a string, false: every kind of value
is_string: false,
# the default value if the user didn't provide one
default_value: false)
]
end

Expand All @@ -62,7 +68,7 @@ def self.return_value

def self.authors
# So no one will ever forget your contribution to fastlane :) You are awesome btw!
["Your GitHub/Twitter Name"]
['Your GitHub/Twitter Name']
end

def self.is_supported?(platform)
Expand Down