Skip to content

Format recipes - #20

Open
bouweandela wants to merge 10 commits into
mainfrom
format-recipe
Open

bouweandela wants to merge 10 commits into
mainfrom
format-recipe

Conversation

@bouweandela

@bouweandela bouweandela commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Format Document formats a recipe with esmvalcore.recipe.format_recipe (ESMValGroup/ESMValCore#3261), which puts the sections of the recipe and the facets of the datasets and variables in a standard order. Only the lines that change are edited, so the editor keeps the cursor position elsewhere.

Like the other features, formatting is only offered for ESMValTool recipes, not for other files named like recipes.

format_recipe removes comments, so recipes with comments are not formatted and the editor shows a warning instead; otherwise format-on-save would silently delete them. Recipes that are not valid YAML are not formatted either.

Tested with pixi run test, pixi run test-vscode, and pixi run pre-commit run --all-files.

🤖 Generated with Claude Code

Format recipes with esmvalcore.recipe.format_recipe, editing only the
lines that change. Recipes with comments are not formatted, because
formatting would remove the comments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov-commenter

codecov-commenter commented Nov 2, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.01299% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.50%. Comparing base (4397523) to head (6d3d60b).

Files with missing lines Patch % Lines
client/src/extension.ts 70.58% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #20      +/-   ##
==========================================
- Coverage   93.71%   93.50%   -0.22%     
==========================================
  Files          21       22       +1     
  Lines        2339     2416      +77     
  Branches      350      356       +6     
==========================================
+ Hits         2192     2259      +67     
- Misses        110      120      +10     
  Partials       37       37              
Flag Coverage Δ
default 95.73% <100.00%> (+0.09%) ⬆️
py312 95.73% <100.00%> (+0.09%) ⬆️
vscode-1.93.0 81.94% <70.58%> (-1.00%) ⬇️
vscode-stable 81.94% <70.58%> (-1.00%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

bouweandela and others added 9 commits November 3, 2026 09:07
Only format files that are ESMValTool recipes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Recipes usually start with comments that identify them, followed by the
document start marker. These no longer prevent a recipe from being
formatted, and formatting keeps them and the marker unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Format Document command can use another extension that formats YAML
files, so the new Format Recipe command asks the language server directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
That branch builds on recipe-json-schema, keeps the paragraphs and lists of
folded descriptions, and keeps the comments before the document start, so the
server no longer needs to handle those comments itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants