Skip to content

Commit

Permalink
cleanup!: drop support for nvim 0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed Jul 16, 2024
1 parent 7f3a9ee commit e36a3d4
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 16 deletions.
1 change: 0 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ jobs:
strategy:
matrix:
include:
- nvim_tag: v0.8.3
- nvim_tag: v0.9.4
- nvim_tag: v0.10.0

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Lightweight yet powerful formatter plugin for Neovim

## Requirements

- Neovim 0.8+
- Neovim 0.9+ (for older versions, use a [nvim-0.x branch](https://github.com/stevearc/conform.nvim/branches))

## Features

Expand Down Expand Up @@ -216,7 +216,7 @@ You can view this list in vim with `:help conform-formatters`
- [darker](https://github.com/akaihola/darker) - Run black only on changed lines.
- [dart_format](https://dart.dev/tools/dart-format) - Replace the whitespace in your program with formatting that follows Dart guidelines.
- [dcm_fix](https://dcm.dev/docs/cli/formatting/fix/) - Fixes issues produced by dcm analyze, dcm check-unused-code or dcm check-dependencies commands.
- [dcm_format](https://dcm.dev/docs/cli/formatting/format/) - Formats *.dart files.
- [dcm_format](https://dcm.dev/docs/cli/formatting/format/) - Formats .dart files.
- [deno_fmt](https://deno.land/manual/tools/formatter) - Use [Deno](https://deno.land/) to format TypeScript, JavaScript/JSON and markdown.
- [dfmt](https://github.com/dlang-community/dfmt) - Formatter for D source code.
- [djlint](https://github.com/Riverside-Healthcare/djLint) - ✨ HTML Template Linter and Formatter. Django - Jinja - Nunjucks - Handlebars - GoLang.
Expand Down
2 changes: 1 addition & 1 deletion doc/conform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ FORMATTERS *conform-formatter
follows Dart guidelines.
`dcm_fix` - Fixes issues produced by dcm analyze, dcm check-unused-code or dcm
check-dependencies commands.
`dcm_format` - Formats *.dart files.
`dcm_format` - Formats .dart files.
`deno_fmt` - Use [Deno](https://deno.land/) to format TypeScript,
JavaScript/JSON and markdown.
`dfmt` - Formatter for D source code.
Expand Down
2 changes: 1 addition & 1 deletion lua/conform/formatters/dcm_format.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
return {
meta = {
url = "https://dcm.dev/docs/cli/formatting/format/",
description = "Formats *.dart files.",
description = "Formats .dart files.",
},
command = "dcm",
args = { "format", "$FILENAME" },
Expand Down
6 changes: 0 additions & 6 deletions lua/conform/formatters/injected.lua
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,6 @@ return {
-- (defaults to the value from formatters_by_ft)
lang_to_formatters = {},
},
condition = function(self, ctx)
local ok, parser = pcall(vim.treesitter.get_parser, ctx.buf)
-- Require Neovim 0.9 because the treesitter API has changed significantly
---@diagnostic disable-next-line: invisible
return ok and parser._injection_query and vim.fn.has("nvim-0.9") == 1
end,
format = function(self, ctx, lines, callback)
local conform = require("conform")
local errors = require("conform.errors")
Expand Down
4 changes: 4 additions & 0 deletions lua/conform/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ end

---@param opts? conform.setupOpts
M.setup = function(opts)
if vim.fn.has("nvim-0.9") == 0 then
notify("conform.nvim requires Neovim 0.9+", vim.log.levels.ERROR)
return
end
opts = opts or {}

M.formatters = vim.tbl_extend("force", M.formatters, opts.formatters or {})
Expand Down
5 changes: 0 additions & 5 deletions tests/injected_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ local injected = require("conform.formatters.injected")
local runner = require("conform.runner")
local test_util = require("tests.test_util")

-- injected formatter only supported on neovim 0.9+
if vim.fn.has("nvim-0.9") == 0 then
return
end

---@param dir string
---@return string[]
local function list_test_files(dir)
Expand Down

0 comments on commit e36a3d4

Please sign in to comment.