-
Notifications
You must be signed in to change notification settings - Fork 14
refactor: convert checkmake and prettierd from fn to standard config #81
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
xiaoshihou514
merged 10 commits into
nvimdev:main
from
barrettruth:refactor/fn-to-standard-config
Feb 12, 2026
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
063b90d
test: add tests for all remaining tools
barrettruth 8b45336
fix(ci): remove duplicate entry and untestable mypyc test
barrettruth 777894c
fix(ci): restore CI config lost during merge
barrettruth 564e321
ci: extract repeated test setup into composite action
barrettruth 29877e5
fix(test): use run_lint/run_fmt instead of manual vim.system
barrettruth 1667213
refactor: convert checkmake and prettierd from fn to standard config
barrettruth d27e079
ci(cljfmt): use standalone binary and extract apt packages to file
barrettruth b98ee9f
test: exercise fn-based linter configs via coroutine helper
barrettruth 09fe422
Merge branch 'main' into refactor/fn-to-standard-config
barrettruth 94c0a84
refactor(test): run assertions inside coroutine in run_lint_fn
barrettruth 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 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
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 |
|---|---|---|
| @@ -1,18 +1,13 @@ | ||
| describe('zsh', function() | ||
| it('can lint', function() | ||
| local linter = require('test.helper').get_linter('zsh') | ||
| local tmpfile = '/tmp/guard-test.zsh' | ||
| vim.fn.writefile({ 'if true; then' }, tmpfile) | ||
| local bufnr = vim.api.nvim_create_buf(false, true) | ||
| local result = vim.system({ 'zsh', '-n', tmpfile }, {}):wait() | ||
| local output = result.stderr or '' | ||
| local diagnostics = linter.parse(output, bufnr) | ||
| assert.is_true(#diagnostics > 0) | ||
| for _, d in ipairs(diagnostics) do | ||
| assert.equal(bufnr, d.bufnr) | ||
| assert.equal('zsh', d.source) | ||
| assert.is_number(d.lnum) | ||
| assert.is_string(d.message) | ||
| end | ||
| local helper = require('test.helper') | ||
| helper.run_lint_fn('zsh', 'zsh', { 'if true; then' }, function(bufnr, diagnostics) | ||
| assert.is_true(#diagnostics > 0) | ||
| for _, d in ipairs(diagnostics) do | ||
| helper.assert_diag(d, { bufnr = bufnr, source = 'zsh' }) | ||
| assert.is_number(d.lnum) | ||
| assert.is_string(d.message) | ||
| end | ||
| end) | ||
| end) | ||
| end) |
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 |
|---|---|---|
| @@ -1,20 +1,12 @@ | ||
| describe('prettierd', function() | ||
| it('can format', function() | ||
| local tmpfile = '/tmp/guard-test.js' | ||
| local input = { | ||
| local formatted = require('test.helper').run_fmt('prettierd', 'js', { | ||
| 'const x={a:1,b:2,c:3}', | ||
| 'const y = [1,2,3,4,5]', | ||
| } | ||
| vim.fn.writefile(input, tmpfile) | ||
| local result = vim | ||
| .system({ 'prettierd', tmpfile }, { stdin = table.concat(input, '\n') }) | ||
| :wait() | ||
| assert.equal(0, result.code) | ||
| local expected = table.concat({ | ||
| }) | ||
| assert.are.same({ | ||
| 'const x = { a: 1, b: 2, c: 3 };', | ||
| 'const y = [1, 2, 3, 4, 5];', | ||
| '', | ||
| }, '\n') | ||
| assert.equal(expected, result.stdout) | ||
| }, formatted) | ||
| end) | ||
| end) |
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 |
|---|---|---|
| @@ -1,19 +1,13 @@ | ||
| describe('cpplint', function() | ||
| it('can lint', function() | ||
| local linter = require('test.helper').get_linter('cpplint') | ||
| local tmpfile = '/tmp/guard-test.cpp' | ||
| local input = { [[int main(){int x=1;}]] } | ||
| vim.fn.writefile(input, tmpfile) | ||
| local bufnr = vim.api.nvim_create_buf(false, true) | ||
| local result = vim.system({ 'cpplint', '--filter=-legal/copyright', tmpfile }, {}):wait() | ||
| local output = result.stderr or '' | ||
| local diagnostics = linter.parse(output, bufnr) | ||
| assert.is_true(#diagnostics > 0) | ||
| for _, d in ipairs(diagnostics) do | ||
| assert.equal(bufnr, d.bufnr) | ||
| assert.equal('cpplint', d.source) | ||
| assert.is_number(d.lnum) | ||
| assert.is_string(d.message) | ||
| end | ||
| local helper = require('test.helper') | ||
| helper.run_lint_fn('cpplint', 'cpp', { [[int main(){int x=1;}]] }, function(bufnr, diagnostics) | ||
| assert.is_true(#diagnostics > 0) | ||
| for _, d in ipairs(diagnostics) do | ||
| helper.assert_diag(d, { bufnr = bufnr, source = 'cpplint' }) | ||
| assert.is_number(d.lnum) | ||
| assert.is_string(d.message) | ||
| end | ||
| end) | ||
| end) | ||
| end) |
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.