Skip to content

Commit

Permalink
fix(ci): setup is deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoshihou514 committed Dec 8, 2024
1 parent 716d7ee commit 9c466c6
Show file tree
Hide file tree
Showing 28 changed files with 1 addition and 32 deletions.
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ describe('black', function()
-- pre-test setup
local ft = require('guard.filetype')
ft('python'):fmt('black')
require('guard').setup()
-- Giving example input to the helper
-- the helper creates a new buffer with it, formats, and returns the formatted output
local formatted = require('test.formatter.helper').test_with('python', {
Expand Down Expand Up @@ -99,7 +98,7 @@ ln -s ~/.local/share/nvim/lazy/guard.nvim/lua/guard lua
ok 1 - <tool-name> can format
ok 1 - <tool-name> can lint
```

- Modify `test/setup.sh` so that CI installs your tool

- Optionally, format the code with stylua
Expand Down
1 change: 0 additions & 1 deletion test/formatter/autopep8_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ describe('autopep8', function()
it('can format', function()
local ft = require('guard.filetype')
ft('python'):fmt('autopep8')
require('guard').setup()

local formatted = require('test.formatter.helper').test_with('python', {
[[def foo(n):]],
Expand Down
3 changes: 0 additions & 3 deletions test/formatter/biome_spec.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
describe('biome', function()
it('can format json', function()
local ft = require('guard.filetype')
ft('json'):fmt('biome')
require('guard').setup()

local formatted = require('test.formatter.helper').test_with('json', {
[[{"name": "dove" , "age":10 ]],
Expand All @@ -16,7 +14,6 @@ describe('biome', function()
it('can format javascript', function()
local ft = require('guard.filetype')
ft('js'):fmt('biome')
require('guard').setup()

local formatted = require('test.formatter.helper').test_with('js', {
[[ const randomNumber = Math.floor(]],
Expand Down
1 change: 0 additions & 1 deletion test/formatter/black_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ describe('black', function()
it('can format', function()
local ft = require('guard.filetype')
ft('python'):fmt('black')
require('guard').setup()

local formatted = require('test.formatter.helper').test_with('python', {
[[def foo(n):]],
Expand Down
1 change: 0 additions & 1 deletion test/formatter/clang-format_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ describe('clang-format', function()
it('can format', function()
local ft = require('guard.filetype')
ft('c'):fmt('clang-format')
require('guard').setup()

local formatted = require('test.formatter.helper').test_with('c', {
[[#include <stdio.h>]],
Expand Down
1 change: 0 additions & 1 deletion test/formatter/docformatter_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ describe('docformatter', function()
it('can format', function()
local ft = require('guard.filetype')
ft('python'):fmt('docformatter')
require('guard').setup()

local formatted = require('test.formatter.helper').test_with('python', {
[[def foo():]],
Expand Down
1 change: 0 additions & 1 deletion test/formatter/gofmt_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ describe('gofmt', function()
it('can format', function()
local ft = require('guard.filetype')
ft('go'):fmt('gofmt')
require('guard').setup()

local formatted = require('test.formatter.helper').test_with('go', {
[[package main]],
Expand Down
1 change: 0 additions & 1 deletion test/formatter/gofumpt_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ describe('gofumpt', function()
it('can format', function()
local ft = require('guard.filetype')
ft('go'):fmt('gofumpt')
require('guard').setup()

local formatted = require('test.formatter.helper').test_with('go', {
[[package main]],
Expand Down
1 change: 0 additions & 1 deletion test/formatter/golines_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ describe('golines', function()
it('can format', function()
local ft = require('guard.filetype')
ft('go'):fmt('golines')
require('guard').setup()

local formatted = require('test.formatter.helper').test_with('go', {
[[package main]],
Expand Down
1 change: 0 additions & 1 deletion test/formatter/latexindent_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ describe('latexindent', function()
it('can format', function()
local ft = require('guard.filetype')
ft('latex'):fmt('latexindent')
require('guard').setup()

local formatted = require('test.formatter.helper').test_with('latex', {
[[\documentclass{article}]],
Expand Down
1 change: 0 additions & 1 deletion test/formatter/prettier_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ describe('prettier', function()
it('can format', function()
local ft = require('guard.filetype')
ft('javascript'):fmt('prettier')
require('guard').setup()

local formatted = require('test.formatter.helper').test_with('javascript', {
[[ const randomNumber = Math.floor(]],
Expand Down
1 change: 0 additions & 1 deletion test/formatter/ruff_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ describe('ruff', function()
it('can format', function()
local ft = require('guard.filetype')
ft('python'):fmt('ruff')
require('guard').setup()

local formatted = require('test.formatter.helper').test_with('python', {
[[def foo(n):]],
Expand Down
1 change: 0 additions & 1 deletion test/formatter/rustfmt_nightly_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ describe('rustfmt_nightly', function()
it('can format', function()
local ft = require('guard.filetype')
ft('rust'):fmt('rustfmt_nightly')
require('guard').setup()

local formatted = require('test.formatter.helper').test_with('rust', {
[[use std::{collections::HashMap, collections::HashSet};]],
Expand Down
1 change: 0 additions & 1 deletion test/formatter/rustfmt_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ describe('rustfmt', function()
it('can format', function()
local ft = require('guard.filetype')
ft('rust'):fmt('rustfmt')
require('guard').setup()

local formatted = require('test.formatter.helper').test_with('rust', {
[[use std::{collections::HashMap, collections::HashSet};]],
Expand Down
1 change: 0 additions & 1 deletion test/formatter/sql-formatter_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ describe('sql-formatter', function()
it('can format', function()
local ft = require('guard.filetype')
ft('sql'):fmt('sql-formatter')
require('guard').setup()

local formatted = require('test.formatter.helper').test_with('sql', {
[[SELECT *]],
Expand Down
2 changes: 0 additions & 2 deletions test/formatter/sqlfluff_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ describe('sqlfluff', function()
local ft = require('guard.filetype')
local tool = ft('sql'):fmt('sqlfluff')
tool.formatter[1].args = vim.list_extend(tool.formatter[1].args, { '--dialect', 'ansi' })
require('guard').setup()

local formatted = require('test.formatter.helper').test_with('sql', {
[[SELECT *]],
Expand All @@ -26,7 +25,6 @@ describe('sqlfluff', function()
local ft = require('guard.filetype')
local tool = ft('sql'):fmt('sqlfluff_fix')
tool.formatter[1].args = vim.list_extend(tool.formatter[1].args, { '--dialect', 'ansi' })
require('guard').setup()

local formatted = require('test.formatter.helper').test_with('sql', {
[[SELECT]],
Expand Down
1 change: 0 additions & 1 deletion test/formatter/stylua_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ describe('stylua', function()
it('can format', function()
local ft = require('guard.filetype')
ft('lua'):fmt('stylua')
require('guard').setup()

local formatted = require('test.formatter.helper').test_with('lua', {
[[local M={}]],
Expand Down
1 change: 0 additions & 1 deletion test/formatter/swiftformat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ describe('swiftformat', function()
it('can format', function()
local ft = require('guard.filetype')
ft('swift'):fmt('swiftformat')
require('guard').setup()

local formatted = require('test.formatter.helper').test_with('swift', {
[[func myFunc() { ]],
Expand Down
1 change: 0 additions & 1 deletion test/formatter/taplo_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ describe('taplo', function()
it('can format', function()
local ft = require('guard.filetype')
ft('toml'):fmt('taplo')
require('guard').setup()

local formatted = require('test.formatter.helper').test_with('toml', {
[[ [dependencies] ]],
Expand Down
1 change: 0 additions & 1 deletion test/formatter/yapf_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ describe('yapf', function()
it('can format', function()
local ft = require('guard.filetype')
ft('python'):fmt('yapf')
require('guard').setup()

local formatted = require('test.formatter.helper').test_with('python', {
[[def foo(n):]],
Expand Down
1 change: 0 additions & 1 deletion test/linter/clang-tidy_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ describe('clang-tidy', function()
local ns = helper.namespace
local ft = require('guard.filetype')
ft('c'):lint('clang-tidy')
require('guard').setup()

local diagnostics = helper.test_with('c', {
[[#include <stdio.h>]],
Expand Down
1 change: 0 additions & 1 deletion test/linter/flake8_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ describe('flake8', function()
local ns = helper.namespace
local ft = require('guard.filetype')
ft('python'):lint('flake8')
require('guard').setup()

local diagnostics = helper.test_with('python', {
[[import os]],
Expand Down
1 change: 0 additions & 1 deletion test/linter/hlint_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ describe('hlint', function()
local ns = helper.namespace
local ft = require('guard.filetype')
ft('haskell'):lint('hlint')
require('guard').setup()

local diagnostics = helper.test_with('haskell', {
[[concat $ map escapeC s]],
Expand Down
1 change: 0 additions & 1 deletion test/linter/luacheck_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ describe('luacheck', function()
local ns = helper.namespace
local ft = require('guard.filetype')
ft('lua'):lint('luacheck')
require('guard').setup()

local diagnostics = helper.test_with('lua', {
[[local M = {}]],
Expand Down
1 change: 0 additions & 1 deletion test/linter/mypy_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ describe('mypy', function()
local ns = helper.namespace
local ft = require('guard.filetype')
ft('python'):lint('mypy')
require('guard').setup()

local diagnostics = helper.test_with('python', {
[[def f(i: int) -> int:]],
Expand Down
1 change: 0 additions & 1 deletion test/linter/pylint_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ describe('pylint', function()
local ns = helper.namespace
local ft = require('guard.filetype')
ft('python'):lint('pylint')
require('guard').setup()

local diagnostics = helper.test_with('python', {
[[def foo(n):]],
Expand Down
1 change: 0 additions & 1 deletion test/linter/ruff_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ describe('ruff', function()
local ns = helper.namespace
local ft = require('guard.filetype')
ft('python'):lint('ruff')
require('guard').setup()

local diagnostics = helper.test_with('python', {
[[import os]],
Expand Down
1 change: 0 additions & 1 deletion test/linter/selene_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ describe('selene', function()
local ns = helper.namespace
local ft = require('guard.filetype')
ft('lua'):lint('selene')
require('guard').setup()

local diagnostics = helper.test_with('lua', {
[[local M = {}]],
Expand Down

0 comments on commit 9c466c6

Please sign in to comment.