Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve md format for jj fix #4322

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cli/src/commands/fix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ use crate::ui::Ui;
///
/// For example, the following configuration defines how two code formatters
/// (`clang-format` and `black`) will apply to three different file extensions
/// (.cc, .h, and .py):
/// (`.cc`, `.h`, and `.py`):
///
/// ```toml
/// [fix.tools.clang-format]
/// command = ["/usr/bin/clang-format", "--assume-filename=$path"]
/// patterns = ["glob:'**/*.cc'",
Expand All @@ -93,6 +94,7 @@ use crate::ui::Ui;
/// [fix.tools.black]
/// command = ["/usr/bin/black", "-", "--stdin-filename=$path"]
/// patterns = ["glob:'**/*.py'"]
/// ```
///
/// Execution order of tools that affect the same file is deterministic, but
/// currently unspecified, and may change between releases. If two tools affect
Expand All @@ -104,8 +106,10 @@ use crate::ui::Ui;
/// example, the following configuration would apply the Rust formatter to all
/// changed files (whether they are Rust files or not):
///
/// ```toml
/// [fix]
/// tool-command = ["rustfmt", "--emit", "stdout"]
/// ```
///
/// The tool defined by `tool-command` acts as if it was the first entry in
/// `fix.tools`, and uses `pattern = "all()"``. Support for `tool-command`
Expand Down
6 changes: 5 additions & 1 deletion cli/tests/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -809,8 +809,9 @@ the values have the following properties:

For example, the following configuration defines how two code formatters
(`clang-format` and `black`) will apply to three different file extensions
(.cc, .h, and .py):
(`.cc`, `.h`, and `.py`):

```toml
[fix.tools.clang-format]
command = ["/usr/bin/clang-format", "--assume-filename=$path"]
patterns = ["glob:'**/*.cc'",
Expand All @@ -819,6 +820,7 @@ patterns = ["glob:'**/*.cc'",
[fix.tools.black]
command = ["/usr/bin/black", "-", "--stdin-filename=$path"]
patterns = ["glob:'**/*.py'"]
```

Execution order of tools that affect the same file is deterministic, but
currently unspecified, and may change between releases. If two tools affect
Expand All @@ -830,8 +832,10 @@ command that will affect all changed files in the specified revisions. For
example, the following configuration would apply the Rust formatter to all
changed files (whether they are Rust files or not):

```toml
[fix]
tool-command = ["rustfmt", "--emit", "stdout"]
```

The tool defined by `tool-command` acts as if it was the first entry in
`fix.tools`, and uses `pattern = "all()"``. Support for `tool-command`
Expand Down