<< All versions

Skill v1.0.0

currentTrusted Publisher100/100
microsoft/ccf/formatting-and-linting
──Details
PublishedOctober 2, 2026 at 02:51 AM
Content Hashsha256:8ed7872cd967ad4c...
Git SHA
──Files
Files (1 file, 5.7 KB)
SKILL.md5.7 KBactive
SKILL.md · 54 lines · 5.7 KB

version: "1.0.0" name: formatting-and-linting user-invocable: false description: "Format and lint CCF changes. Use when choosing or running checks for C++, Python, TypeScript, JavaScript, Markdown, YAML, JSON, CMake, shell scripts, or release notes, and when deciding which checks support automatic fixes."


Formatting and linting

Scope and prerequisites

Run commands from the repository root. scripts/ci-checks.sh runs the individual checks concurrently, including a build-configuration check. Use the global instructions' validation policy to choose targeted local checks or the full suite.

The Copilot setup workflow runs scripts/setup-ubuntu-ci-checks.sh for Ubuntu formatting/lint prerequisites. Some checks use uvx or npm to obtain tools at runtime and need network access. The test-bucket check additionally requires the full CMake configure prerequisites; the setup workflow does not install those.

Check first, fix only task-owned changes

  • Run scripts without -f initially. Success is exit status 0; inspect failure output to distinguish changed-file issues, unrelated failures, and environment blockers.
  • The scripts generally scan whole directories or tracked files, not just the diff. Selecting a script by file type does not restrict which files it may rewrite.
  • For auto-fix, use the existing underlying formatter/linter with explicit changed-file paths and the same version/configuration used by the script. Only fix files or hunks owned by the task; preserve existing user edits.
  • Use a script's -f mode only after verifying its complete write scope is intended. Do not run repository-wide auto-fix as a default.
  • Inspect the resulting diff and rerun the applicable check. Do not remove unrelated edits to make checks pass. Report blockers and unrelated failures under the global validation policy.

Check inventory

Each command below is under scripts/. This table is a routing guide; the scripts own exact file coverage, exclusions, tool versions, and options. When changing that coverage, update this guide too. Include cross-cutting checks (copyright, disallowed comments, ASCII) when applicable.

ScriptRelevant changesTool/checkSupports auto-fix
cpp-format-checks.shC/C++ in include/, src/, samples/clang-format-f
lean-format-checks.shAll tracked Lean filesleanfmt-f
python-format-checks.shPython in tests/, python/, scripts/, tla/black-f
python-lint-checks.shPython in python/, tests/ruff-f
python-types-checks.shPython SDKmypyNo
prettier-checks.shTS, JS, Markdown, YAML, JSON (excluding tests/sandbox/)prettier-f
cmake-format-checks.shCMake filesgersemi-f
release-notes-checks.shCHANGELOG.md (also run prettier)extract-release-notes.py-f
shellcheck-checks.shShell scripts outside 3rdparty/shellcheckNo
includes-checks.shPublic C++ headers and their usesPublic/private include and exported-header checksNo
copyright-checks.shSource filesCopyright noticesNo
openapi-checks.shJSON under doc/schemas/openapi-spec-validatorNo
todo-checks.shTracked filesDisallowed commentsNo
ascii-checks.shSource/config files and agent-instruction MarkdownASCII policy and grandfathered Unicode linesNo
ascii-policy-tests.shASCII policy/checker changesASCII policy regression testsNo
test-buckets-checks.shCMake test registration, defaults, or tests/ci-buckets.txtFresh configure and CI bucket inventory comparisonNo

Some report-only scripts accept -f for interface compatibility without changing files. For Rust or other file types not covered by a formatter above, consult their existing build/CI configuration rather than introducing a new tool.

The Lean formatting check runs in .github/workflows/lean.yml, not scripts/ci-checks.sh. It requires elan and the package's Lean toolchain. See Lean formatting setup.

The ASCII check includes Rust and TLA+, but exempts Lean source files (*.lean). Existing Unicode is grandfathered by exact line hashes, not file-wide exemptions. Do not extend the grandfathered hashes to accept new Unicode.

All versions