Skip to content

Commit

Permalink
Quick rubocop cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bougyman committed Feb 2, 2024
1 parent 4327406 commit e28487d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
linear-cli (0.4.4)
linear-cli (0.4.5)
base64 (~> 0.2)
dry-cli (~> 1.0)
dry-cli-completion (~> 1.0)
Expand Down
18 changes: 11 additions & 7 deletions lib/linear/cli/sub_commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@ def const_added(const)
end
end

def ask_for_team # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
def choose_a_team!(teams)
prompt.on(:keypress) do |event|
prompt.trigger(:keydown) if event.value == 'j'
prompt.trigger(:keyup) if event.value == 'k'
end
key = prompt.select('Choose a team', teams.to_h { |t| [t.name, t.key] })
Rubyists::Linear::Team.find key
end

def ask_for_team
teams = Rubyists::Linear::Team.mine
if teams.size == 1
logger.info('Only one team found, using it', team: teams.first.name)
Expand All @@ -24,12 +33,7 @@ def ask_for_team # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
logger.error('No teams found for you. Please join a team or pass an existing team name.')
raise SmellsBad, 'No team given and none found for you'
else
prompt.on(:keypress) do |event|
prompt.trigger(:keydown) if event.value == 'j'
prompt.trigger(:keyup) if event.value == 'k'
end
key = prompt.select('Choose a team', teams.to_h { |t| [t.name, t.key] })
Rubyists::Linear::Team.find key
choose_a_team! teams
end
end

Expand Down
5 changes: 3 additions & 2 deletions lib/linear/commands/issue/create.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

require 'semantic_logger'
require_relative '../issue'

module Rubyists
# Namespace for Linear
Expand All @@ -14,11 +15,11 @@ module Issue
class Create
include SemanticLogger::Loggable
include Rubyists::Linear::CLI::CommonOptions
include Rubyists::Linear::CLI::Issue # for #gimme_da_issue and other methods
include Rubyists::Linear::CLI::Issue # for #gimme_da_issue! and other Issue methods
desc 'Create a new issue'
option :title, type: :string, aliases: ['-t'], desc: 'Issue Title'
option :team, type: :string, aliases: ['-T'], desc: 'Team Identifier'
option :description, type: :string, aliases: ['-d'], desc: 'Issue Description'
option :team, type: :string, aliases: ['-T'], desc: 'Team Identifier'
option :labels, type: :array, aliases: ['-l'], desc: 'Labels for the issue (Comma separated list)'

def call(**options)
Expand Down

0 comments on commit e28487d

Please sign in to comment.