Skip to content

Commit 78086c4

Browse files
authored
Rename section to Persistent line breaks (#356)
So it reads more like a list of features
1 parent 07485dc commit 78086c4

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

docs/formatter.qmd

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ editor:
77
---
88

99
Air is first and foremost a formatter of R code.
10-
On this page, you'll find details about what a formatter is, why you'd want to use one, and you'll learn about how Air makes decisions on how to format your R code.
10+
On this page, you'll find details about what a formatter is, why you'd want to use one, and you'll learn about features that help you anticipate how Air will format your R code.
1111

1212
# What's a formatter?
1313

@@ -92,7 +92,20 @@ By agreeing to use a formatter in a project, collaborators no longer have to dis
9292
Code sent to you by a colleague will adhere to the standards that you're used to.
9393
Code review no longer has to be about style nitpicks and can focus on the substance of the changes instead.
9494

95-
# How does Air decide how to format your code?
95+
# When does a formatter run?
96+
97+
The most convenient way to run a formatter is when you save a file.
98+
Most editors don't enable this by default, so check out the [Editors](editors.qmd) section to learn how to configure your editor to format on save.
99+
Once enabled, your code will be reformatted every time you save!
100+
This prevents your code from ever diverging from the standards set by Air.
101+
102+
Air also provides a [CLI tool](cli.qmd).
103+
It makes it easy to reformat whole directories, such as an R project or package, using a single call to `air format <path>`.
104+
105+
Note that in both of these cases, the formatter will only run if your code is syntactically correct.
106+
If the formatter is seemingly no longer working, check your code for syntax errors.
107+
108+
# Persistent line breaks
96109
97110
Air tries to strike a balance between enforcing rigid rules and allowing authors some control over the layout.
98111
Our main source of styling rules is the [Tidyverse style guide](https://style.tidyverse.org), but we occasionally deviate from these.
@@ -605,17 +618,3 @@ skip = ["graph_from_literal"]
605618

606619
One particularly common use of this is `skip = ["tribble"]`, which you can use to avoid formatting of all `tibble::tribble()` calls.
607620
In the long term, Air may provide more sophisticated tooling for formatting using a specified alignment.
608-
609-
# When does a formatter run?
610-
611-
The most convenient way to run a formatter is when you save a file.
612-
Most editors don't enable this by default, so check out the [Editors](editors.qmd) section to learn how to configure your editor to format on save.
613-
Once enabled, your code will be reformatted every time you save!
614-
This prevents your code from ever diverging from the standards set by Air.
615-
616-
Air also provides a [CLI tool](cli.qmd).
617-
It makes it easy to reformat whole directories such as an R project or package.
618-
If you're incorporating Air into an existing project, you may want to use the CLI tool to run air format once on the entire project, commit those results, and then rely on per-file format on save from there on out.
619-
620-
Note that in all of these cases, the formatter will only run if your code is syntactically correct.
621-
If the formatter is seemingly no longer working, check your code for syntax errors.

0 commit comments

Comments
 (0)