Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
ruby:
- '3.3.0'
- '3.4.7'

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
require:
plugins:
- rubocop-rake
- rubocop-rspec

AllCops:
TargetRubyVersion: 3.2.0
TargetRubyVersion: 3.4.0
NewCops: enable

Style/StringLiterals:
Expand Down
2 changes: 1 addition & 1 deletion Readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Then you can just run 'lc' to use the CLI.

=== Gem install (Most should use this)

Requires ruby 3.2 or later
Requires ruby 3.4 or later

[source,sh]
----
Expand Down
3 changes: 2 additions & 1 deletion lib/linear.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module Rubyists
# Namespace for Linear classes
module Linear
include SemanticLogger::Loggable

# rubocop:disable Layout/SpaceAroundOperators
ROOT = (Pathname(__FILE__)/'../..').expand_path
LIBROOT = ROOT/:lib/:linear
Expand Down Expand Up @@ -47,7 +48,7 @@ def self.verbosity
end

def self.verbosity=(debug)
return verbosity unless debug
return unless debug

logger.warn 'Debug level should be between 0 and 3' unless debug.between?(0, 3)
@verbosity = debug
Expand Down
1 change: 1 addition & 0 deletions lib/linear/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module Linear
# Responsible for making requests to the Linear API
class GraphApi
include SemanticLogger::Loggable

BASE_URI = 'https://api.linear.app/graphql'
RETRY_AFTER = lambda do |*|
@retries ||= 0
Expand Down
1 change: 1 addition & 0 deletions lib/linear/cli/caller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module CLI
# This module is prepended to all commands to log their calls
module Caller
include SemanticLogger::Loggable

def self.prepended(mod) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
# Global options for all commands
mod.instance_eval do
Expand Down
2 changes: 1 addition & 1 deletion lib/linear/cli/what_for.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def pr_type_for(issue)
end

def pr_scope_for(title)
proposed_scope = title.match(/^\w+\(([^\)]+)\)/)
proposed_scope = title.match(/^\w+\(([^)]+)\)/)
return proposed_scope[1].downcase if proposed_scope

scope = prompt.ask('What is the scope of this PR?', default: 'none')
Expand Down
1 change: 1 addition & 0 deletions lib/linear/commands/issue/create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Create
include SemanticLogger::Loggable
include Rubyists::Linear::CLI::CommonOptions
include Rubyists::Linear::CLI::Issue # for #gimme_da_issue! and other Issue methods

desc 'Create a new issue. If you do not pass any options, you will be prompted for the required information.'
option :description, type: :string, aliases: ['-d'], desc: 'Issue Description'
option :labels, type: :array, aliases: ['-l'], desc: 'Labels for the issue (Comma separated list)'
Expand Down
1 change: 1 addition & 0 deletions lib/linear/commands/issue/develop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class Develop
include SemanticLogger::Loggable
include Rubyists::Linear::CLI::CommonOptions
include Rubyists::Linear::CLI::Issue # for #gimme_da_issue! and other Issue methods

desc 'Start or update development status of an issue'
argument :issue_id, required: true, desc: 'The Issue (i.e. ISS-1)'

Expand Down
1 change: 1 addition & 0 deletions lib/linear/commands/issue/pr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class Pr
include SemanticLogger::Loggable
include Rubyists::Linear::CLI::CommonOptions
include Rubyists::Linear::CLI::Issue # for #gimme_da_issue! and other Issue methods

desc 'Create a PR for an issue and push it to the remote'
argument :issue_id, required: true, desc: 'The Issue (i.e. CRY-1)'
option :title, required: false, desc: 'The title of the PR'
Expand Down
1 change: 1 addition & 0 deletions lib/linear/commands/issue/take.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Take
include SemanticLogger::Loggable
include Rubyists::Linear::CLI::CommonOptions
include Rubyists::Linear::CLI::Issue # for #gimme_da_issue! and other Issue methods

desc 'Assign one or more issues to yourself'
argument :issue_ids, type: :array, required: true, desc: 'Issue Identifiers'

Expand Down
1 change: 1 addition & 0 deletions lib/linear/commands/issue/update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class Update
include SemanticLogger::Loggable
include Rubyists::Linear::CLI::CommonOptions
include Rubyists::Linear::CLI::Issue # for #gimme_da_issue! and other Issue methods

desc 'Update an issue'
argument :issue_ids, type: :array, required: true, desc: 'Issue IDs (i.e. CRY-1)'
option :comment, type: :string, aliases: ['-m'], desc: 'Comment to add to the issue. - open an editor'
Expand Down
1 change: 1 addition & 0 deletions lib/linear/commands/team.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module CLI
# The Team module is the namespace for all team-related commands
module Team
include CLI::SubCommands

# Aliases for Team commands.
ALIASES = {
list: %w[ls l], # aliases for the list command
Expand Down
1 change: 1 addition & 0 deletions lib/linear/fragments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module Linear
# Reusable fragments
module Fragments
extend GQLi::DSL

PageInfo = fragment('PageInfo', 'PageInfo') do
pageInfo do
hasNextPage
Expand Down
1 change: 1 addition & 0 deletions lib/linear/models/base_model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class BaseModel
include GQLi::DSL
include SemanticLogger::Loggable
extend ClassMethods

attr_reader :data, :updated_data

CANCELLED_STATES = %w[cancelled canceled].freeze
Expand Down
1 change: 1 addition & 0 deletions lib/linear/models/comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module Linear
# The Comment class represents a Linear issue comment.
class Comment
include SemanticLogger::Loggable

many_to_one :user

Base = fragment('BaseComment', 'Comment') do
Expand Down
1 change: 1 addition & 0 deletions lib/linear/models/issue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module Linear
class Issue # rubocop:disable Metrics/ClassLength
include SemanticLogger::Loggable
extend ClassMethods

many_to_one :assignee, :User
many_to_one :team
one_to_many :comments
Expand Down
2 changes: 1 addition & 1 deletion lib/linear/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def slug
File.basename(url).sub("-#{slugId}", '')
end

def match_score?(string)
def match_score?(string) # rubocop:disable Naming/PredicateMethod
return 100 if matches_attributes?(string, :id, :url)

downed = string.downcase
Expand Down
1 change: 1 addition & 0 deletions lib/linear/models/team.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module Linear
# The Issue class represents a Linear issue.
class Team
include SemanticLogger::Loggable

one_to_many :projects

# TODO: Make this configurable
Expand Down
27 changes: 14 additions & 13 deletions linear-cli.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
spec.summary = 'CLI for interacting with Linear.app.'
spec.description = 'A CLI for interacting with Linear.app. Loosely based on the GitHub CLI'
spec.homepage = 'https://github.com/rubyists/linear-cli'
spec.required_ruby_version = '>= 3.2.0'
spec.required_ruby_version = '>= 3.4.0'

spec.license = 'MIT'
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
Expand All @@ -34,19 +34,20 @@ Gem::Specification.new do |spec|
spec.require_paths = ['lib']

# Uncomment to register a new dependency of your gem
spec.add_dependency 'base64', '~> 0.2'
spec.add_dependency 'dry-cli', '~> 1.0'
spec.add_dependency 'dry-cli-completion', '~> 1.0'
spec.add_dependency 'git', '~> 1.5'
spec.add_dependency 'gqli', '~> 1.2'
spec.add_dependency 'httpx', '~> 1.2'
spec.add_dependency 'base64'
spec.add_dependency 'dry-cli'
spec.add_dependency 'dry-cli-completion'
spec.add_dependency 'git'
spec.add_dependency 'gqli'
spec.add_dependency 'httpx'
spec.add_dependency 'pry-byebug'
spec.add_dependency 'semantic_logger', '~> 4.0'
spec.add_dependency 'sequel', '~> 5.0'
spec.add_dependency 'sqlite3', '~> 1.7'
spec.add_dependency 'tty-editor', '~> 0.7'
spec.add_dependency 'tty-markdown', '~> 0.7'
spec.add_dependency 'tty-prompt', '~> 0.23'
spec.add_dependency 'reline'
spec.add_dependency 'semantic_logger'
spec.add_dependency 'sequel'
spec.add_dependency 'sqlite3'
spec.add_dependency 'tty-editor'
spec.add_dependency 'tty-markdown'
spec.add_dependency 'tty-prompt'

# For more information and examples about making a new gem, check out our
# guide at: https://bundler.io/guides/creating_gem.html
Expand Down
2 changes: 2 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tools]
ruby = "3.4.7"