llvm / llvm/llvm-project

[clang-tidy] Rename `--export-fixes` to `--export-diagnostics`, keeping `--export-fixes` as a compatibility alias

Open
#197,300 1 comment 0 reactions 0 assignees View on GitHub
clang-tidy enhancement
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

`clang-tidy`'s `--export-fixes` option writes a YAML file containing Diagnostics entries.
Those diagnostics may or may not contain fix-it replacements. In practice, this is
also the main machine-readable diagnostics export path, but the current option name
suggests that only fixable diagnostics are exported.

This is confusing for users who want to consume all clang-tidy findings, including
diagnostics with empty Replacements lists.

Proposal:
1. Add `--export-diagnostics` as a clearer spelling.
2. Keep `--export-fixes` as a compatibility alias.
3. Update `clang-tidy` and `run-clang-tidy.py` help/docs to describe the output as diagnostics with optional replacements.
4. Optionally deprecate `--export-fixes` in release notes and fire a warning when it's used, but do not remove it immediately.

Question for maintainers:
Should `--export-fixes` remain as a permanent alias, or should we follow a staged
deprecation path? If staged, is one or more major releases of overlap expected for
a widely used clang-tidy CLI option?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.