mirror of
https://github.com/TimUntersberger/neogit
synced 2024-09-16 14:24:09 +02:00
rubocopping
This commit is contained in:
parent
a223cd34d8
commit
3ab8ba3466
8 changed files with 34 additions and 20 deletions
13
.github/workflows/lint.yml
vendored
13
.github/workflows/lint.yml
vendored
|
@ -12,13 +12,10 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- uses: taiki-e/install-action@v2
|
||||
with:
|
||||
tool: selene,typos-cli
|
||||
|
||||
- name: Run linters
|
||||
run: make lint
|
||||
|
||||
|
@ -32,3 +29,13 @@ jobs:
|
|||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
version: latest
|
||||
args: --color always --check lua/ tests/
|
||||
|
||||
ruby_lint:
|
||||
name: Rubocop
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
bundler-cache: true
|
||||
- run: bundle exec rubocop
|
||||
|
|
10
.rubocop.yml
10
.rubocop.yml
|
@ -5,3 +5,13 @@ AllCops:
|
|||
TargetRubyVersion: 3.3.1
|
||||
Style/StringLiterals:
|
||||
EnforcedStyle: double_quotes
|
||||
RSpec/DescribeClass:
|
||||
Enabled: false
|
||||
RSpec/MultipleExpectations:
|
||||
Enabled: false
|
||||
RSpec/ExampleLength:
|
||||
Enabled: false
|
||||
RSpec/NestedGroups:
|
||||
Enabled: false
|
||||
Style/NestedModifier:
|
||||
Enabled: false
|
||||
|
|
|
@ -116,9 +116,7 @@ RSpec.describe "Branch Popup", :git, :nvim do
|
|||
end
|
||||
|
||||
describe "Create new branch" do
|
||||
it "can create a new branch" do
|
||||
|
||||
end
|
||||
it "can create a new branch"
|
||||
end
|
||||
|
||||
describe "Create new spin-off" do
|
||||
|
@ -150,6 +148,7 @@ RSpec.describe "Branch Popup", :git, :nvim do
|
|||
end
|
||||
|
||||
describe "pull request" do
|
||||
it "can open a pull-request"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -29,7 +29,7 @@ RSpec.configure do |config|
|
|||
|
||||
config.include Helpers
|
||||
|
||||
config.around(:each) do |example|
|
||||
config.around do |example|
|
||||
with_remote = example.metadata.fetch(:with_remote_origin, false)
|
||||
|
||||
Dir.mktmpdir do |local|
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
RSpec.shared_context "git", :git do
|
||||
RSpec.shared_context "with git", :git do
|
||||
let(:git) { Git.open(Dir.pwd) }
|
||||
|
||||
before do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
RSpec.shared_context "nvim", :nvim do
|
||||
RSpec.shared_context "with nvim", :nvim do
|
||||
let(:nvim) { NeovimClient.new }
|
||||
|
||||
before { nvim.setup }
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
return if ENV["CI"]
|
||||
|
||||
def dir_name(name)
|
||||
name.match(/[^\/]+\/(?<dir_name>[^\.]+)/)[:dir_name]
|
||||
name.match(%r{[^/]+/(?<dir_name>[^\.]+)})[:dir_name]
|
||||
end
|
||||
|
||||
def ensure_installed(name)
|
||||
tmp = File.join(PROJECT_DIR, "tmp")
|
||||
Dir.mkdir(tmp) if !Dir.exist?(tmp)
|
||||
FileUtils.mkdir_p(tmp)
|
||||
|
||||
dir = File.join(tmp, dir_name(name))
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ class NeovimClient
|
|||
@instance = nil
|
||||
end
|
||||
|
||||
def setup
|
||||
def setup # rubocop:disable Metrics/MethodLength
|
||||
@instance = attach_child
|
||||
|
||||
# Sets up the runtimepath
|
||||
|
@ -30,7 +30,7 @@ class NeovimClient
|
|||
@instance = nil
|
||||
end
|
||||
|
||||
def print_screen
|
||||
def print_screen # rubocop:disable Metrics/MethodLength
|
||||
@instance.command("redraw")
|
||||
|
||||
screen = []
|
||||
|
@ -63,7 +63,7 @@ class NeovimClient
|
|||
# Overload vim.fn.input() to prevent blocking.
|
||||
def input(*args)
|
||||
lua <<~LUA
|
||||
local inputs = { #{args.map(&:inspect).join(",")} }
|
||||
local inputs = { #{args.map(&:inspect).join(',')} }
|
||||
|
||||
vim.fn.input = function()
|
||||
return table.remove(inputs, 1)
|
||||
|
@ -71,16 +71,14 @@ class NeovimClient
|
|||
LUA
|
||||
end
|
||||
|
||||
def keys(keys)
|
||||
def keys(keys) # rubocop:disable Metrics/MethodLength
|
||||
keys = keys.chars
|
||||
|
||||
while keys.length > 0
|
||||
until keys.empty?
|
||||
key = keys.shift
|
||||
if key == "<"
|
||||
key += keys.shift until key.last == ">"
|
||||
end
|
||||
key += keys.shift until key.last == ">" if key == "<"
|
||||
|
||||
if (written = @instance.input(key)).nil?
|
||||
if @instance.input(key).nil?
|
||||
assert_alive!
|
||||
raise "Failed to write key to neovim: #{key.inspect}"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue