Run 'rake rubocop:{apply,copy}'

This commit is contained in:
0x1eef 2024-04-08 17:47:59 -03:00
parent 8804dad6bc
commit b54b177431
14 changed files with 18 additions and 9 deletions

View file

@ -19,6 +19,8 @@ AllCops:
- libexec/*/**
- bin/*
- test/*
Exclude:
- src/css/vendor/tail.css/bin/*
##
# Enabled

View file

@ -24,6 +24,8 @@ AllCops:
- libexec/*/**
- bin/*
- test/*
Exclude:
- src/css/vendor/tail.css/bin/*
##
# Enabled

View file

@ -24,6 +24,8 @@ AllCops:
- libexec/*/**
- bin/*
- test/*
Exclude:
- src/css/vendor/tail.css/bin/*
##
# Enabled

View file

@ -6,7 +6,6 @@ require "nanoc-webpack"
buildenv = ENV["buildenv"] || "development"
Nanoc::Webpack.default_argv.concat ["--config", "webpack.#{buildenv}.js"]
def require_rules(rules, locals = {}, target = binding)
locals.each { target.local_variable_set(_1, _2) }
path = File.join(Dir.getwd, rules)

View file

@ -24,6 +24,8 @@ AllCops:
- libexec/*/**
- bin/*
- test/*
Exclude:
- src/css/vendor/tail.css/bin/*
##
# Enabled

View file

@ -1,4 +1,5 @@
# frozen_string_literal: true
module Twenty::GraphQL
require "graphql"
require_relative "graphql/input"

View file

@ -5,6 +5,6 @@ module Twenty::GraphQL::Input
argument :title, String, required: false
argument :content, String, required: false
argument :project_id, Int, required: false
argument :status, 'Twenty::GraphQL::Type::TaskStatus', required: false
argument :status, "Twenty::GraphQL::Type::TaskStatus", required: false
end
end

View file

@ -5,7 +5,7 @@ module Twenty::GraphQL::Mutation
argument :project_id, Int, required: true
field :errors, [String], null: false
field :project, 'Twenty::GraphQL::Type::Project', null: true
field :project, "Twenty::GraphQL::Type::Project", null: true
def resolve(project_id:)
project = Twenty::Project.with_pk!(project_id)

View file

@ -6,6 +6,6 @@ module Twenty::GraphQL::Type
field :name, String, null: false
field :path, String, null: false
field :color, String, null: false
field :tasks, '[Twenty::GraphQL::Type::Task]', null: false
field :tasks, "[Twenty::GraphQL::Type::Task]", null: false
end
end

View file

@ -11,7 +11,6 @@ module Twenty::GraphQL::Type
end
field :projects, [Project], null: false
def find_task(task_id:)
Twenty::Task.with_pk!(task_id)
end

View file

@ -4,9 +4,9 @@ module Twenty::GraphQL::Type
class Task < GraphQL::Schema::Object
field :id, Int, null: false
field :title, String, null: false
field :status, 'Twenty::GraphQL::Type::TaskStatus', null: false
field :status, "Twenty::GraphQL::Type::TaskStatus", null: false
field :content, String, null: false
field :project, 'Twenty::GraphQL::Type::Project', null: false
field :project, "Twenty::GraphQL::Type::Project", null: false
field :updated_at, GraphQL::Types::ISO8601DateTime, null: false
field :is_ready, Boolean, null: false, method: :ready?
field :is_backlogged, Boolean, null: false, method: :backlog?

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
Sequel.migration do
up do
create_table(:projects) do

View file

@ -4,7 +4,7 @@ class Twenty::Task < Sequel::Model
include Twenty::Model
plugin(:enum)
STATUS_MAP = {backlog: 0, ready: 1, in_progress: 2, complete: 3}
STATUS_MAP = {backlog: 0, ready: 1, in_progress: 2, complete: 3}
STATUS_KEYS = STATUS_MAP.keys
enum :status, STATUS_MAP

View file

@ -14,7 +14,7 @@ module Twenty::Rack
def call(env)
req = Rack::Request.new(env)
if req.post? &&
req.path == "/graphql"
req.path == "/graphql"
params = JSON.parse(req.body.string)
result = Twenty::GraphQL::Schema.execute(
params["query"],