-
Notifications
You must be signed in to change notification settings - Fork 49
Add option to sort discussions by file name #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
43d1157
add option to sort discussions by file name
johnybx ac24dd8
initialize lua tests with neovim and busted framework - works also wi…
johnybx cd33147
fix lint
johnybx 8402749
fix .busted
johnybx b9cb610
simplify test scripts
johnybx 3662edf
try to update github workflow to run lua tests
johnybx b049066
fix workflow, get rid of unnecessary details in test scripts
johnybx 733e695
add tests for building discussion nodes
johnybx 438eccc
remove print
johnybx b0cb0b2
this change does not belong to this PR
johnybx f081d15
update workflow name
johnybx 9d91996
update highlights for discussion_tree
johnybx 962e5d5
make date strings more distinguishable
johnybx 85d39a7
fix edit / delete note
johnybx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ on: | |
| - main | ||
| jobs: | ||
| lua_lint: | ||
| name: Lint Lua 💅 | ||
| name: Lint Lua 💅 | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
|
|
@@ -15,7 +15,7 @@ jobs: | |
| with: | ||
| args: --globals vim --no-max-line-length -- . | ||
| lua_format: | ||
| name: Formatting Lua 💅 | ||
| name: Formatting Lua 💅 | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
|
|
@@ -27,11 +27,29 @@ jobs: | |
| version: latest | ||
| args: --check . | ||
| lua_test: | ||
| name: Test Lua 🧪 | ||
| needs: [lua_format,lua_lint] | ||
| name: Run tests 🧪 | ||
| strategy: | ||
| matrix: | ||
| nvim_version: [stable, nightly] | ||
|
|
||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
| - name: Run Busted | ||
| uses: lunarmodules/[email protected] | ||
| uses: actions/checkout@v4 | ||
| - name: Install neovim | ||
| uses: rhysd/action-setup-vim@v1 | ||
| id: vim | ||
| with: | ||
| neovim: true | ||
| version: ${{ matrix.nvim_version }} | ||
| - name: Install luajit | ||
| uses: leafo/gh-actions-lua@v10 | ||
| with: | ||
| luaVersion: "luajit-2.1.0-beta3" | ||
| - name: Install luarocks | ||
| uses: leafo/gh-actions-luarocks@v4 | ||
| - name: Run tests | ||
| shell: bash | ||
| run: | | ||
| chmod +x lua-test.sh | ||
| ./lua-test.sh | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,3 +3,7 @@ bin | |
| /luarocks | ||
| /lua_modules | ||
| /.luarocks | ||
| *.rockspec | ||
| tests/plugins | ||
| !tests/plugins/.placeholder | ||
| luacov.* | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| include = { | ||
| "lua/gitlab/" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # Process generated luacov stats file into coverage report for gitlab.nvim. | ||
| # | ||
| set -e | ||
|
|
||
| if ! [[ -f luacov.stats.out ]]; then | ||
| echo "You need to first run \`./lua-test.sh --coverage\`" | ||
| exit 1 | ||
| fi | ||
|
|
||
| eval "$(luarocks path)" | ||
| luacov "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # Setup and run tests for lua part of gitlab.nvim. | ||
| # | ||
| # In order to run tests you need to have `luarocks` and `git` installed. This script will check if | ||
| # environment is already setup, if not it will initialize current directory with `luarocks`, | ||
| # install `busted` framework and download plugin dependencies. | ||
| # | ||
| # | ||
| set -e | ||
|
|
||
| LUA_VERSION="5.1" | ||
| PLUGINS_FOLDER="tests/plugins" | ||
| PLUGINS=( | ||
| "https://github.com/MunifTanjim/nui.nvim" | ||
| "https://github.com/nvim-lua/plenary.nvim" | ||
| "https://github.com/sindrets/diffview.nvim" | ||
| ) | ||
|
|
||
| if ! command -v luarocks > /dev/null 2>&1; then | ||
| echo "You need to have luarocks installed in order to run tests." | ||
| exit 1 | ||
| fi | ||
|
|
||
| if ! command -v git > /dev/null 2>&1; then | ||
| echo "You need to have git installed in order to run tests." | ||
| exit 1 | ||
| fi | ||
|
|
||
| if ! luarocks --lua-version=$LUA_VERSION which busted > /dev/null 2>&1; then | ||
| echo "Installing busted." | ||
| luarocks init | ||
| luarocks config --scope project lua_version "$LUA_VERSION" | ||
| luarocks install --lua-version="$LUA_VERSION" busted | ||
| fi | ||
|
|
||
| for arg in "$@"; do | ||
| if [[ $arg =~ "--coverage" ]] && ! luarocks --lua-version=$LUA_VERSION which luacov > /dev/null 2>&1; then | ||
| luarocks install --lua-version="$LUA_VERSION" luacov | ||
| # lcov reporter for luacov - lcov format is supported by `nvim-coverage` | ||
| luarocks install --lua-version="$LUA_VERSION" luacov-reporter-lcov | ||
| fi | ||
| done | ||
|
|
||
| for plugin in "${PLUGINS[@]}"; do | ||
| plugin_name=${plugin##*/} | ||
| plugin_folder="$PLUGINS_FOLDER/$plugin_name" | ||
|
|
||
| # Check if plugin was already downloaded | ||
| if [[ -d "$plugin_folder/.git" ]]; then | ||
| # We could also try to pull here but I am not sure if that wouldn't slow down tests too much. | ||
| continue | ||
| fi | ||
|
|
||
| git clone --depth 1 "$plugin" "$plugin_folder" | ||
|
|
||
| done | ||
|
|
||
| nvim -u NONE -U NONE -N -i NONE -l tests/init.lua "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| ---@meta diagnostics | ||
|
|
||
| ---@class Author | ||
| ---@field id integer | ||
| ---@field username string | ||
| ---@field email string | ||
| ---@field name string | ||
| ---@field state string | ||
| ---@field avatar_url string | ||
| ---@field web_url string | ||
|
|
||
| ---@class LinePosition | ||
| ---@field line_code string | ||
| ---@field type string | ||
|
|
||
| ---@class GitlabLineRange | ||
| ---@field start LinePosition | ||
| ---@field end LinePosition | ||
|
|
||
| ---@class NotePosition | ||
| ---@field base_sha string | ||
| ---@field start_sha string | ||
| ---@field head_sha string | ||
| ---@field position_type string | ||
| ---@field new_path string? | ||
| ---@field new_line integer? | ||
| ---@field old_path string? | ||
| ---@field old_line integer? | ||
| ---@field line_range GitlabLineRange? | ||
|
|
||
| ---@class Note | ||
| ---@field id integer | ||
| ---@field type string | ||
| ---@field body string | ||
| ---@field attachment string | ||
| ---@field title string | ||
| ---@field file_name string | ||
| ---@field author Author | ||
| ---@field system boolean | ||
| ---@field expires_at string? | ||
| ---@field updated_at string? | ||
| ---@field created_at string? | ||
| ---@field noteable_id integer | ||
| ---@field noteable_type string | ||
| ---@field commit_id string | ||
| ---@field position NotePosition | ||
| ---@field resolvable boolean | ||
| ---@field resolved boolean | ||
| ---@field resolved_by Author | ||
| ---@field resolved_at string? | ||
| ---@field noteable_iid integer | ||
|
|
||
| ---@class UnlinkedNote: Note | ||
| ---@field position nil | ||
|
|
||
| ---@class Discussion | ||
| ---@field id string | ||
| ---@field individual_note boolean | ||
| ---@field notes Note[] | ||
|
|
||
| ---@class UnlinkedDiscussion: Discussion | ||
| ---@field notes UnlinkedNote[] | ||
|
|
||
| ---@class DiscussionData | ||
| ---@field discussions Discussion[] | ||
| ---@field unlinked_discussions UnlinkedDiscussion[] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.