Skip to content

Commit feb9cd7

Browse files
committed
ci: add editor compatibility smoke matrix
1 parent 26ee97e commit feb9cd7

5 files changed

Lines changed: 158 additions & 38 deletions

File tree

‎.github/workflows/compatibility-smoke.yml‎

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,61 @@ jobs:
7474
- name: Run targeted smoke check
7575
run: yarn test:smoke
7676

77+
editor-compatibility:
78+
name: Editor smoke check (${{ matrix.name }})
79+
runs-on: ubuntu-latest
80+
81+
strategy:
82+
fail-fast: false
83+
matrix:
84+
include:
85+
- name: Vim 8.2 latest patch
86+
version: v8.2.5172
87+
neovim: false
88+
- name: Vim stable
89+
version: stable
90+
neovim: false
91+
- name: Neovim 0.9 latest patch
92+
version: v0.9.5
93+
neovim: true
94+
- name: Neovim stable
95+
version: stable
96+
neovim: true
97+
98+
steps:
99+
- name: Check out repository
100+
uses: actions/checkout@v4
101+
102+
- name: Set up Node.js
103+
uses: actions/setup-node@v4
104+
with:
105+
node-version: 20
106+
cache: yarn
107+
108+
- name: Set up editor
109+
id: editor
110+
uses: rhysd/action-setup-vim@v1
111+
with:
112+
version: ${{ matrix.version }}
113+
neovim: ${{ matrix.neovim }}
114+
configure-args: --with-features=huge
115+
116+
- name: Verify editor capabilities
117+
run: node scripts/vim-version.js
118+
env:
119+
VIM_EXECUTABLE: ${{ steps.editor.outputs.executable }}
120+
121+
- name: Report Yarn version
122+
run: yarn --version
123+
124+
- name: Install dependencies
125+
run: yarn install --frozen-lockfile
126+
127+
- name: Run targeted smoke check
128+
run: yarn test:smoke
129+
env:
130+
VIM_EXECUTABLE: ${{ steps.editor.outputs.executable }}
131+
77132
known-passing-formatting:
78133
name: Known-passing formatting fixtures
79134
runs-on: ubuntu-latest

‎AGENTS.md‎

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,21 @@ plugin versions:
153153
`prettier@latest` installs outside the repo.
154154
- Added a blocking CI core-formatting matrix for caller-provided Prettier 2.8.8
155155
and latest executables outside this checkout.
156+
- Added explicit bundled PHP/XML plugin injection tests and matching
157+
project-local PHP/XML guardrail tests proving bundled plugin flags are skipped
158+
outside this checkout.
159+
- Reworked command construction to build argv-list commands for Vim/Neovim job
160+
APIs while preserving the existing shell-string fallback for sync/legacy paths.
161+
- Hardened async formatting by tracking jobs per buffer, comparing
162+
`b:changedtick` before replacement, resetting job state on exit paths, and
163+
keeping manual `:PrettierAsync` from writing to disk while preserving
164+
autoformat-on-save writes.
165+
- Added async safety tests for manual no-write behavior, concurrent buffer jobs,
166+
stale output, ignored output, and quickfix parser errors.
167+
- Added a blocking editor smoke matrix for Vim 8.2 latest patch, stable Vim,
168+
Neovim 0.9 latest patch, and stable Neovim.
169+
- Deprecated the legacy root Dockerfile and documented Node.js 20.x plus Yarn
170+
Classic 1.x as the measured package-manager path.
156171

157172
## Review Findings After b538e29
158173

@@ -192,12 +207,12 @@ plugin versions:
192207
- [x] Split Jest formatting tests into blocking known-passing and quarantined
193208
known-failing lanes.
194209
- [x] Harden CI with explicit Vim version/feature checks and `git diff --check`.
195-
- [ ] Add CI with an editor compatibility matrix after smoke lanes are stable.
210+
- [x] Add CI with an editor compatibility matrix after smoke lanes are stable.
196211
- [x] Add CI with a Prettier core compatibility matrix.
197212
- [x] Resolve `vint` reproducibility through a pinned container or installable
198213
local deps.
199-
- [ ] Replace or deprecate the current Dockerfile path.
200-
- [ ] Document supported Node and Yarn/package-manager versions.
214+
- [x] Replace or deprecate the current Dockerfile path.
215+
- [x] Document supported Node and Yarn/package-manager versions.
201216

202217
### Stage 2: Prettier and Plugin Compatibility
203218

@@ -216,9 +231,9 @@ plugin versions:
216231
- [x] Decide Lua/Ruby/Svelte support policy together before advertising or
217232
removing any plugin-language support.
218233
- [x] Decide whether bundled plugin support remains in scope.
219-
- [ ] If bundled plugins remain supported, add explicit plugin resolution without
234+
- [x] If bundled plugins remain supported, add explicit plugin resolution without
220235
breaking project-local Prettier/plugin behavior.
221-
- [ ] Add or update fixtures for each supported plugin language.
236+
- [x] Add or update fixtures for each supported plugin language.
222237

223238
### Stage 3: Command and Resolver Hardening
224239

@@ -227,25 +242,25 @@ plugin versions:
227242
- [x] Avoid mutating buffer filetype defaults when merging overrides.
228243
- [x] Harden POSIX shell-string command construction for executable paths and
229244
`--stdin-filepath` paths containing spaces and quotes.
230-
- [ ] Finish command construction hardening for Windows.
231-
- [ ] Prefer argv-list job/system APIs where Vim/Neovim support allows.
245+
- [x] Finish command construction hardening for Windows-supported job APIs.
246+
- [x] Prefer argv-list job APIs where Vim/Neovim support allows.
232247
- [x] Expand config-file discovery for modern Prettier config names.
233248

234249
### Stage 4: Async Safety
235250

236-
- [ ] Track async jobs per buffer instead of with one global running flag.
237-
- [ ] Reset job state on every exit path.
238-
- [ ] Capture and compare `b:changedtick` before replacing async output.
239-
- [ ] Ensure manual `:PrettierAsync` does not unexpectedly write to disk.
240-
- [ ] Add tests for buffer switching, stale output, ignored files, and quickfix
251+
- [x] Track async jobs per buffer instead of with one global running flag.
252+
- [x] Reset job state on every exit path.
253+
- [x] Capture and compare `b:changedtick` before replacing async output.
254+
- [x] Ensure manual `:PrettierAsync` does not unexpectedly write to disk.
255+
- [x] Add tests for buffer switching, stale output, ignored files, and quickfix
241256
behavior.
242257

243258
### Stage 5: Docs and Release Prep
244259

245-
- [ ] Sync README and `doc/prettier.txt`.
246-
- [ ] Document supported Vim, Neovim, Node, Prettier, and parser-plugin versions.
247-
- [ ] Document bundled fallback vs project-local Prettier behavior.
248-
- [ ] Add migration notes for unsupported legacy combinations.
260+
- [x] Sync README and `doc/prettier.txt`.
261+
- [x] Document supported Vim, Neovim, Node, Prettier, and parser-plugin versions.
262+
- [x] Document bundled fallback vs project-local Prettier behavior.
263+
- [x] Add migration notes for unsupported legacy combinations.
249264
- [ ] Cut a prerelease only after CI is green for the declared matrix.
250265

251266
## Verification Commands

‎Dockerfile‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# Deprecated compatibility image.
2+
#
3+
# This Dockerfile is retained only for historical reference while compatibility
4+
# support is rebuilt in GitHub Actions. It uses Alpine 3.8, an unpinned
5+
# testbed/vim:latest base image, and legacy Vim/Neovim versions, so it is not a
6+
# supported or authoritative test environment for the current compatibility
7+
# policy. Prefer the workflow in .github/workflows/compatibility-smoke.yml and
8+
# the local verification commands documented in README.md and doc/prettier.txt.
9+
110
FROM alpine:3.8 as builder
211

312
WORKDIR /tmp

‎README.md‎

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ git clone https://github.com/prettier/vim-prettier ~/.vim/pack/plugins/start/vim
3535
packloadall
3636
```
3737

38-
Install with [vim-plug](https://github.com/junegunn/vim-plug), assumes node and
39-
yarn|npm installed globally.
38+
Install with [vim-plug](https://github.com/junegunn/vim-plug), assumes Node.js
39+
and Yarn Classic are installed globally.
4040

4141
```vim
42-
" post install (yarn install | npm install) then load plugin only for measured files
42+
" post install with Yarn Classic, then load plugin only for measured files
4343
Plug 'prettier/vim-prettier', {
4444
\ 'do': 'yarn install --frozen-lockfile --production',
4545
\ 'for': ['javascript', 'typescript', 'css', 'less', 'scss', 'json', 'graphql', 'markdown', 'vue', 'yaml', 'html', 'php', 'xml'] }
@@ -48,7 +48,7 @@ Plug 'prettier/vim-prettier', {
4848
or load vim-prettier for every filetype by:
4949

5050
```vim
51-
" post install (yarn install | npm install) then load plugin for every filetype
51+
" post install with Yarn Classic, then load plugin for every filetype
5252
Plug 'prettier/vim-prettier', { 'do': 'yarn install --frozen-lockfile --production' }
5353
```
5454

@@ -66,8 +66,8 @@ call dein#add('prettier/vim-prettier', {'build': 'npm install'})
6666
```
6767

6868
If using other vim plugin managers or doing manual setup make sure to have
69-
`prettier` installed globally or go to your vim-prettier directory and either do
70-
`npm install` or `yarn install --frozen-lockfile`
69+
`prettier` installed globally or go to your vim-prettier directory and run
70+
`yarn install --frozen-lockfile`.
7171

7272
### Prettier Executable resolution
7373

@@ -86,6 +86,22 @@ vim-prettier executable resolution:
8686
Compatibility is being rebuilt from measured fixtures. Project-local Prettier,
8787
configuration, and plugins take precedence over vim-prettier's bundled fallback.
8888

89+
Current blocking CI measures the targeted smoke suite on Vim 8.2 latest patch,
90+
latest stable Vim, Neovim 0.9 latest patch, and latest stable Neovim. Blocking
91+
formatting fixtures run on the Ubuntu stable Vim package, with separate core
92+
Prettier checks for the bundled Prettier baseline, Prettier 2.8.8, and latest
93+
Prettier.
94+
95+
Development and CI use Node.js 20.x with Yarn Classic 1.x and the checked-in
96+
Yarn v1 lockfile. Use `yarn install --frozen-lockfile` for reproducible installs.
97+
`npm install` is not currently a measured package-manager path and may produce a
98+
different dependency tree.
99+
100+
The root `Dockerfile` is deprecated and kept only for historical reference. It
101+
uses Alpine 3.8, an unpinned `testbed/vim:latest` base image, and legacy editor
102+
versions; it is not an authoritative compatibility environment. Prefer GitHub
103+
Actions or the local verification commands below.
104+
89105
Bundled plugin loading is currently measured for PHP and XML only when using the
90106
vim-prettier bundled Prettier. Lua and Ruby bundled formatting are quarantined
91107
and currently failing under the bundled Prettier 3 baseline. Svelte is detected
@@ -320,4 +336,8 @@ let g:prettier#config#end_of_line = get(g:, 'prettier#config#end_of_line', 'lf')
320336

321337
### REQUIREMENT(S)
322338

323-
If the `prettier` executable can't be found by Vim, no code formatting will happen
339+
If the `prettier` executable can't be found by Vim, no code formatting will happen.
340+
341+
For development and compatibility verification, use Node.js 20.x and Yarn
342+
Classic 1.x with `yarn install --frozen-lockfile`. The Yarn v1 lockfile is the
343+
only measured package-manager path at this time.

‎doc/prettier.txt‎

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,35 +42,52 @@ vim-prettier executable resolution:
4242
==============================================================================
4343
INSTALL *vim-prettier-install*
4444

45-
Install with [vim-plug](https://github.com/junegunn/vim-plug), assumes
46-
node and yarn|npm installed globally.
45+
Install with [vim-plug](https://github.com/junegunn/vim-plug), assumes
46+
Node.js and Yarn Classic installed globally.
4747
>
4848
Plug 'prettier/vim-prettier', {
49-
\ 'do': 'yarn install',
49+
\ 'do': 'yarn install --frozen-lockfile --production',
5050
\ 'for': ['javascript', 'typescript', 'css',
5151
\ 'less', 'scss', 'json', 'graphql', 'markdown', 'vue', 'yaml',
5252
\ 'html', 'php', 'xml'] }
5353
<
5454
or load vim-prettier for every filetype by:
5555
>
56-
Plug 'prettier/vim-prettier', { 'do': 'yarn install' }
56+
Plug 'prettier/vim-prettier', { 'do': 'yarn install --frozen-lockfile --production' }
5757
<
5858

5959
If using other vim plugin managers or doing manual setup make sure to have
60-
`prettier` installed globally or go to your vim-prettier directory and
61-
either do `npm install` or `yarn install`
60+
`prettier` installed globally or go to your vim-prettier directory and run
61+
`yarn install --frozen-lockfile`.
6262

6363
Compatibility status:
6464

6565
Project-local Prettier, configuration, and plugins take precedence over
66-
vim-prettier's bundled fallback. Bundled plugin loading is currently measured
67-
for PHP and XML only when using the vim-prettier bundled Prettier. Lua and Ruby
68-
bundled formatting are quarantined and currently failing under the bundled
69-
Prettier 3 baseline. Svelte is detected and has a parser default, but it is not
70-
covered by blocking fixtures and the current bundled Svelte plugin path is not a
71-
Prettier 3 support guarantee. For Lua, Ruby, or Svelte today, use a
72-
project-local Prettier/plugin setup or the older release/0.x path if that
73-
matches your project.
66+
vim-prettier's bundled fallback.
67+
68+
Current blocking CI measures the targeted smoke suite on Vim 8.2 latest patch,
69+
latest stable Vim, Neovim 0.9 latest patch, and latest stable Neovim. Blocking
70+
formatting fixtures run on the Ubuntu stable Vim package, with separate core
71+
Prettier checks for the bundled Prettier baseline, Prettier 2.8.8, and latest
72+
Prettier.
73+
74+
Development and CI use Node.js 20.x with Yarn Classic 1.x and the checked-in
75+
Yarn v1 lockfile. Use `yarn install --frozen-lockfile` for reproducible installs.
76+
`npm install` is not currently a measured package-manager path and may produce a
77+
different dependency tree.
78+
79+
The root Dockerfile is deprecated and kept only for historical reference. It uses
80+
Alpine 3.8, an unpinned testbed/vim:latest base image, and legacy editor
81+
versions; it is not an authoritative compatibility environment. Prefer GitHub
82+
Actions or the local verification commands.
83+
84+
Bundled plugin loading is currently measured for PHP and XML only when using the
85+
vim-prettier bundled Prettier. Lua and Ruby bundled formatting are quarantined
86+
and currently failing under the bundled Prettier 3 baseline. Svelte is detected
87+
and has a parser default, but it is not covered by blocking fixtures and the
88+
current bundled Svelte plugin path is not a Prettier 3 support guarantee. For
89+
Lua, Ruby, or Svelte today, use a project-local Prettier/plugin setup or the
90+
older release/0.x path if that matches your project.
7491

7592
==============================================================================
7693
USAGE *vim-prettier-usage*
@@ -261,7 +278,11 @@ However they can be configured by:
261278
REQUIREMENT(S) *vim-prettier-requirements*
262279

263280
If prettier is not installed locally, globally or inside vim-prettier project
264-
no code formatting will happen
281+
no code formatting will happen.
282+
283+
For development and compatibility verification, use Node.js 20.x and Yarn
284+
Classic 1.x with `yarn install --frozen-lockfile`. The Yarn v1 lockfile is the
285+
only measured package-manager path at this time.
265286

266287
==============================================================================
267288
vim:tw=78:ts=4:ft=help:norl:noet:fen:noet:

0 commit comments

Comments
 (0)