forked from mirrors/jj
docs: improve md format for jj fix
This commit is contained in:
parent
8ead72e99f
commit
ac7fa1abb9
2 changed files with 10 additions and 2 deletions
|
@ -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'",
|
||||
|
@ -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
|
||||
|
@ -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`
|
||||
|
|
|
@ -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'",
|
||||
|
@ -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
|
||||
|
@ -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`
|
||||
|
|
Loading…
Reference in a new issue