Skip to content

Commit

Permalink
Indent blankline v3
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-reineke committed Sep 28, 2023
1 parent 9637670 commit 13e415c
Show file tree
Hide file tree
Showing 40 changed files with 4,677 additions and 1,788 deletions.
2 changes: 2 additions & 0 deletions .cbfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[languages]
lua = ["stylua -s -"]
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Bug Report
description: Report a problem with indent-blankline
labels: [bug]
body:
- type: markdown
attributes:
value: |
_Before reporting:_ Make sure you are on the latest version of the plugin, and either the latest stable or nightly release of Neovim. Search [existing issues](https://github.com/lukas-reineke/indent-blankline.nvim/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc)
- type: textarea
attributes:
label: 'Problem'
description: 'Describe the current behavior. Include images, or videos if possible.'
validations:
required: true
- type: textarea
attributes:
label: 'Steps to reproduce'
description: |
- Share your configurtaion and describe the steps to reproduce the issue.
- See [Minimal-reproduction-template](https://github.com/lukas-reineke/indent-blankline.nvim/wiki/Minimal-reproduction-template#minimal-config) for how to create a minimal configuration.
placeholder: |
nvim --clean
:edit foo
yiwp
validations:
required: true
- type: textarea
attributes:
label: 'Expected behavior'
description: 'Describe the behavior you expect.'
validations:
required: true

- type: input
attributes:
label: 'Neovim version (nvim -v)'
placeholder: '0.6.0 commit db1b0ee3b30f'
validations:
required: true
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Feature request
description: Request an enhancement for indent-blankline
labels: [enhancement]
body:
- type: markdown
attributes:
value: |
Before requesting: search [existing issues](https://github.com/lukas-reineke/indent-blankline.nvim/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) and read the documentation `:help indent-blankline`.
- type: textarea
attributes:
label: 'Problem'
description: 'Describe the problem to be solved.'
placeholder: 'Add bongocat'
validations:
required: true

- type: textarea
attributes:
label: 'Expected behavior'
description: 'Describe what the new feature or behavior would look like. How does it solve the problem? Is it worth the cost?'
validations:
required: true
60 changes: 60 additions & 0 deletions .github/workflows/nightly-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Nightly Neovim check
# Checks LSP and unit tests against new Neovim nightly once a week

on:
schedule:
- cron: '30 21 * * 0' # 6:30 AM JST, Monday
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
tests:
name: unit tests
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
test -d _neovim || {
mkdir -p _neovim
curl -sL "https://github.com/neovim/neovim/releases/download/v0.9.1/nvim-linux64.tar.gz" | tar xzf - --strip-components=1 -C "${PWD}/_neovim"
}
- name: Run tests
run: |
export PATH="${PWD}/_neovim/bin:${PATH}"
export VIM="${PWD}/_neovim/share/nvim/runtime"
nvim --version
make test
lua-language-server:
name: lua language server
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Restore cache for lua LS
uses: actions/cache@v3
with:
path: _lua-ls
key: 3.7.0
- name: Prepare
run: |
test -d _neovim || {
mkdir -p _neovim
curl -sL "https://github.com/neovim/neovim/releases/download/nightly/nvim-linux64.tar.gz" | tar xzf - --strip-components=1 -C "${PWD}/_neovim"
}
test -d _lua-ls || {
mkdir -p _lua-ls
curl -sL "https://github.com/LuaLS/lua-language-server/releases/download/3.7.0/lua-language-server-3.7.0-linux-x64.tar.gz" | tar xzf - -C "${PWD}/_lua-ls"
}
- name: Run check
run: |
export PATH="${PWD}/_neovim/bin:${PATH}"
export PATH="${PWD}/_lua-ls/bin:${PATH}"
export VIM="${PWD}/_neovim/share/nvim/runtime"
nvim --version
make lua-language-server version=nightly
127 changes: 104 additions & 23 deletions .github/workflows/pr_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,122 @@ name: Pull request check
on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
format:
runs-on: ubuntu-latest
tests:
name: unit tests
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- version: nightly
rev: nightly/nvim-linux64.tar.gz
- version: stable
rev: v0.9.2/nvim-linux64.tar.gz
steps:
- uses: actions/checkout@v2
- uses: JohnnyMorganz/[email protected]
- uses: actions/checkout@v3
- run: date +%F > todays-date
- name: Restore cache for today's nightly.
uses: actions/cache@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --check .
path: _neovim
key: ${{ matrix.rev }}-${{ hashFiles('todays-date') }}
- name: Prepare
run: |
test -d _neovim || {
mkdir -p _neovim
curl -sL "https://github.com/neovim/neovim/releases/download/${{ matrix.rev }}" | tar xzf - --strip-components=1 -C "${PWD}/_neovim"
}
block-fixup:
runs-on: ubuntu-latest
- name: Run tests
run: |
export PATH="${PWD}/_neovim/bin:${PATH}"
export VIM="${PWD}/_neovim/share/nvim/runtime"
nvim --version
make test
lua-language-server:
name: lua language server
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- version: nightly
rev: nightly/nvim-linux64.tar.gz
- version: stable
rev: v0.9.2/nvim-linux64.tar.gz
steps:
- uses: actions/checkout@v2
- name: Block Fixup Commit Merge
uses: 13rac1/[email protected]
- uses: actions/checkout@v3
- run: date +%F > todays-date
- name: Restore cache for today's nightly.
uses: actions/cache@v3
with:
path: _neovim
key: ${{ matrix.rev }}-${{ hashFiles('todays-date') }}
- name: Restore vendor dependencies
uses: actions/cache@v3
with:
path: vendor
key: ${{ hashFiles('todays-date') }}
- name: Restore cache for lua LS
uses: actions/cache@v3
with:
path: _lua-ls
key: 3.7.0
- name: Prepare
run: |
test -d _neovim || {
mkdir -p _neovim
curl -sL "https://github.com/neovim/neovim/releases/download/${{ matrix.rev }}" | tar xzf - --strip-components=1 -C "${PWD}/_neovim"
}
test -d _lua-ls || {
mkdir -p _lua-ls
curl -sL "https://github.com/LuaLS/lua-language-server/releases/download/3.7.0/lua-language-server-3.7.0-linux-x64.tar.gz" | tar xzf - -C "${PWD}/_lua-ls"
}
luacheck:
runs-on: ubuntu-latest
- name: Run check
run: |
export PATH="${PWD}/_neovim/bin:${PATH}"
export PATH="${PWD}/_lua-ls/bin:${PATH}"
export VIM="${PWD}/_neovim/share/nvim/runtime"
nvim --version
make lua-language-server version=${{ matrix.version }}
stylua:
name: stylua
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@master

- uses: leafo/[email protected]
- uses: actions/checkout@v3
- uses: JohnnyMorganz/stylua-action@v3
with:
luaVersion: 'luajit-2.1.0-beta3'
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
args: --color always --check .

- uses: leafo/[email protected]
luacheck:
name: luacheck
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: build
- name: Prepare
run: |
luarocks install luacheck
sudo apt-get update
sudo apt-get install -y luarocks
sudo luarocks install luacheck
- name: test
run: |
luacheck lua
- name: Lint
run: sudo make luacheck

block-fixup:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
- name: Block Fixup Commit Merge
uses: 13rac1/[email protected]
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
vendor/*
lua-language-server-log/*
_neovim/*
_lua-ls/*
6 changes: 5 additions & 1 deletion .luacheckrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
globals = { "vim", "_" }
globals = { "vim", "_", "describe", "it", "after_each", "before_each", "assert" }
max_line_length = false

exclude_files = {
"vendor",
}
18 changes: 18 additions & 0 deletions .luarc.nightly.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"runtime.version": "LuaJIT",
"diagnostics.globals": [
"it",
"describe",
"before_each",
"after_each",
"setup",
"teardown"
],
"diagnostics.ignoredFiles": "Disable",
"diagnostics.libraryFiles": "Disable",
"workspace.library": [
"/usr/local/share/nvim/runtime/lua",
"_neovim/share/nvim/runtime/lua",
"vendor/pack/vendor/start/neodev.nvim/types/nightly"
]
}
18 changes: 18 additions & 0 deletions .luarc.stable.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"runtime.version": "LuaJIT",
"diagnostics.globals": [
"it",
"describe",
"before_each",
"after_each",
"setup",
"teardown"
],
"diagnostics.ignoredFiles": "Disable",
"diagnostics.libraryFiles": "Disable",
"workspace.library": [
"/usr/local/share/nvim/runtime/lua",
"_neovim/share/nvim/runtime/lua",
"vendor/pack/vendor/start/neodev.nvim/types/stable"
]
}
4 changes: 4 additions & 0 deletions .styluaignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
vendor/*
lua-language-server-log/*
_neovim/*
_lua-ls/*
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT Licence

Copyright (c) 2022 Lukas Reineke
Copyright (c) 2023 Lukas Reineke

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
ifndef VERBOSE
.SILENT:
endif

test: dependencies
@echo "Running indent-blankline tests..."
timeout 300 nvim -e \
--headless \
--noplugin \
-u specs/spec.lua \
-c "PlenaryBustedDirectory specs/features {minimal_init = 'specs/spec.lua'}"

luacheck:
luacheck .

stylua:
stylua --check .

lua-language-server: dependencies
rm -rf lua-language-server-log
lua-language-server --configpath .luarc.$(version).json --logpath lua-language-server-log --check .
[ -f lua-language-server-log/check.json ] && { cat lua-language-server-log/check.json 2>/dev/null; exit 1; } || true

dependencies:
if [ ! -d vendor ]; then \
git clone --depth 1 \
https://github.com/nvim-lua/plenary.nvim \
vendor/pack/vendor/start/plenary.nvim; \
git clone --depth 1 \
https://github.com/folke/neodev.nvim \
vendor/pack/vendor/start/neodev.nvim; \
fi
Loading

0 comments on commit 13e415c

Please sign in to comment.