From c7944209712e8dd71887b4841110719b7b5f361d Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Sat, 11 Jul 2026 07:16:03 -0700 Subject: [PATCH] lint: record VS Code config rule + rename EditorConfig step + process-type tasks - AGENTS.md: VS Code settings and extension recommendations live only in the .code-workspace, never a standalone .vscode/settings.json or .vscode/extensions.json (.vscode/ holds only tasks.json and launch.json). - Rename the "Check line endings" CI step and the "Lint: Line Endings" VS Code task to "EditorConfig" - the tool enforces charset, whitespace, and final-newline too, not just EOL. - VS Code Lint tasks: type: process with an args array instead of type: shell with a command string, for robustness and consistency with the rest of the tasks file. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/test-pull-request.yml | 2 +- AGENTS.md | 4 ++-- catalog/snippets/configs/vscode-tasks.json | 24 +++++++++++++--------- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-pull-request.yml b/.github/workflows/test-pull-request.yml index 7ae89cf9..05dff1e5 100644 --- a/.github/workflows/test-pull-request.yml +++ b/.github/workflows/test-pull-request.yml @@ -39,7 +39,7 @@ jobs: - name: Lint workflows step uses: raven-actions/actionlint@3d39aea434753780c3b3d4a1a31c854b4dbf49d7 # v2.2.0 - - name: Check line endings step + - name: Check EditorConfig step run: docker run --rm -v "$PWD":/check --workdir /check mstruebing/editorconfig-checker:latest - name: Validate registry and spec step diff --git a/AGENTS.md b/AGENTS.md index d178cfd3..4825c5e2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -231,7 +231,7 @@ CI runs the full lint set, but run the linters locally before pushing to catch i - **CI (authoritative)** runs **markdownlint-cli2**, **cspell**, and **actionlint** as pinned action wrappers (Dependabot bumps them), plus **editorconfig-checker** via Docker `:latest` (its action only installs the CLI, so the Docker one-liner is what actually runs the check). - **The [`.husky/pre-commit`](./catalog/snippets/husky/pre-commit) hook** runs **language formatting only** - CSharpier + `dotnet format` (or ruff) via native tooling, no Docker and no doc linters, so it stays fast. -- **The VS Code [Lint tasks](./catalog/snippets/configs/vscode-tasks.json)** run the full doc-lint set via Docker `:latest` on demand, the local surface for Markdown, spelling, workflow, and line-ending checks. +- **The VS Code [Lint tasks](./catalog/snippets/configs/vscode-tasks.json)** run the full doc-lint set via Docker `:latest` on demand, the local surface for Markdown, spelling, workflow, and EditorConfig checks. The Docker invocations below are the same ones the VS Code tasks use, for ad-hoc or headless (agent) runs. @@ -278,7 +278,7 @@ Contributors commit to this repo with signed commits; the SSH-signing setup live ## Editor and Tasks - **VS Code is the primary IDE, and the experience favors it.** Prefer VS Code tasks and launch configurations for building, running, and testing over ad-hoc shell scripts; a script is the fallback, not the default. -- The `.code-workspace` file carries the shared editor settings and the recommended-extension set. A **standard set** of extensions applies to every repo (markdownlint, cspell, editorconfig, markdown-all-in-one, better-todo-tree, github-actions, actionlint, shellcheck, claude-code); **language-specific** extensions are added per project (.NET: csdevkit, csharpier; Python: python, pylance, ruff, mypy; Docker: the Docker extension). The catalog holds the full set and per-language additions: [`catalog/snippets/vscode/`](./catalog/snippets/vscode/). +- The `.code-workspace` file carries the shared editor settings and the recommended-extension set. **All VS Code settings and extension recommendations live only here, never in a standalone `.vscode/settings.json` or `.vscode/extensions.json`** (`.vscode/` holds only `tasks.json` and `launch.json`). A **standard set** of extensions applies to every repo (markdownlint, cspell, editorconfig, markdown-all-in-one, better-todo-tree, github-actions, actionlint, shellcheck, claude-code); **language-specific** extensions are added per project (.NET: csdevkit, csharpier; Python: python, pylance, ruff, mypy; Docker: the Docker extension). The catalog holds the full set and per-language additions: [`catalog/snippets/vscode/`](./catalog/snippets/vscode/). - The Table of Contents is maintained by the Markdown All in One extension; `markdown.extension.toc.levels` in the workspace sets which heading levels it includes (see the Markdown rules for the authoring convention and the `` exclusion marker). - **Agents: editing the active `.code-workspace` can reload the VS Code window and drop the agent's session.** Commit all state first, prefer opening the folder rather than the workspace while editing it, or leave workspace edits to the maintainer (a maintainer edit does not reload). diff --git a/catalog/snippets/configs/vscode-tasks.json b/catalog/snippets/configs/vscode-tasks.json index a706963e..8f528439 100644 --- a/catalog/snippets/configs/vscode-tasks.json +++ b/catalog/snippets/configs/vscode-tasks.json @@ -123,9 +123,10 @@ // Lint group - the local full doc-lint surface (Docker at :latest), matching the CI lint set. // Run on demand. The pre-commit hook does language formatting only. Every repo carries these. { - "label": "Lint: Line Endings", - "type": "shell", - "command": "docker run --rm -v \"${workspaceFolder}:/check\" -w /check mstruebing/editorconfig-checker:latest", + "label": "Lint: EditorConfig", + "type": "process", + "command": "docker", + "args": [ "run", "--rm", "-v", "${workspaceFolder}:/check", "-w", "/check", "mstruebing/editorconfig-checker:latest" ], "problemMatcher": [], "presentation": { "showReuseMessage": false, @@ -134,8 +135,9 @@ }, { "label": "Lint: Workflows", - "type": "shell", - "command": "docker run --rm -v \"${workspaceFolder}:/repo\" -w /repo rhysd/actionlint:latest -color", + "type": "process", + "command": "docker", + "args": [ "run", "--rm", "-v", "${workspaceFolder}:/repo", "-w", "/repo", "rhysd/actionlint:latest", "-color" ], "problemMatcher": [], "presentation": { "showReuseMessage": false, @@ -144,8 +146,9 @@ }, { "label": "Lint: Markdown", - "type": "shell", - "command": "docker run --rm -v \"${workspaceFolder}:/workdir\" -w /workdir davidanson/markdownlint-cli2:latest \"**/*.md\"", + "type": "process", + "command": "docker", + "args": [ "run", "--rm", "-v", "${workspaceFolder}:/workdir", "-w", "/workdir", "davidanson/markdownlint-cli2:latest", "**/*.md" ], "problemMatcher": [], "presentation": { "showReuseMessage": false, @@ -154,8 +157,9 @@ }, { "label": "Lint: Spelling", - "type": "shell", - "command": "docker run --rm -v \"${workspaceFolder}:/workdir\" -w /workdir ghcr.io/streetsidesoftware/cspell:latest --no-progress \"**/*.md\"", + "type": "process", + "command": "docker", + "args": [ "run", "--rm", "-v", "${workspaceFolder}:/workdir", "-w", "/workdir", "ghcr.io/streetsidesoftware/cspell:latest", "--no-progress", "**/*.md" ], "problemMatcher": [], "presentation": { "showReuseMessage": false, @@ -166,7 +170,7 @@ "label": "Lint: All", "dependsOrder": "sequence", "dependsOn": [ - "Lint: Line Endings", + "Lint: EditorConfig", "Lint: Workflows", "Lint: Markdown", "Lint: Spelling"