Skip to content

Commit

Permalink
Delete spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Melentyev committed Jun 21, 2021
1 parent 58c63cf commit 71f01d1
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 31 deletions.
10 changes: 5 additions & 5 deletions CHANGELOG.md
Expand Up @@ -176,7 +176,7 @@ https://rust-lang.github.io/rustfmt/?version=v1.4.33&search=#imports_granularity

### Changed

- Original comment indentation for trailing comments within an `if` is now taken into account when determining the indentation level to use for the trailing comment in formatted code. This does not modify any existing code formatted with rustfmt; it simply gives the programmer discretion to specify whether the comment is associated to the `else` block, or if the trailing comment is just a member of the `if` block. ([#1575](https://github.com/rust-lang/rustfmt/issues/1575), [#4120](https://github.com/rust-lang/rustfmt/issues/4120), [#4506](https://github.com/rust-lang/rustfmt/issues/4506))
- Original comment indentation for trailing comments within an `if` is now taken into account when determining the indentation level to use for the trailing comment in formatted code. This does not modify any existing code formatted with rustfmt; it simply gives the programmer discretion to specify whether the comment is associated to the `else` block, or if the trailing comment is just a member of the `if` block. ([#1575](https://github.com/rust-lang/rustfmt/issues/1575), [#4120](https://github.com/rust-lang/rustfmt/issues/4120), [#4506](https://github.com/rust-lang/rustfmt/issues/4506))

In this example the `// else comment` refers to the `else`:
```rust
Expand Down Expand Up @@ -213,7 +213,7 @@ if toks.eat_token(Token::Word("modify"))? && toks.eat_token(Token::Word("labels"

### Fixed
- Formatting of empty blocks with attributes which only contained comments is no longer butchered.([#4475](https://github.com/rust-lang/rustfmt/issues/4475), [#4467](https://github.com/rust-lang/rustfmt/issues/4467), [#4452](https://github.com/rust-lang/rustfmt/issues/4452#issuecomment-705886282), [#4522](https://github.com/rust-lang/rustfmt/issues/4522))
- Indentation of trailing comments in non-empty extern blocks is now correct. ([#4120](https://github.com/rust-lang/rustfmt/issues/4120#issuecomment-696491872))
- Indentation of trailing comments in non-empty extern blocks is now correct. ([#4120](https://github.com/rust-lang/rustfmt/issues/4120#issuecomment-696491872))

### Install/Download Options
- **crates.io package** - *pending*
Expand Down Expand Up @@ -297,7 +297,7 @@ if toks.eat_token(Token::Word("modify"))? && toks.eat_token(Token::Word("labels"
- Fix aligning comments of different group
- Fix flattening imports with a single `self`.
- Fix removing attributes on function parameters.
- Fix removing `impl` keyword from opaque type.
- Fix removing `impl` keyword from opaque type.

## [1.4.8] 2019-09-08

Expand Down Expand Up @@ -329,7 +329,7 @@ if toks.eat_token(Token::Word("modify"))? && toks.eat_token(Token::Word("labels"

- Add `--message-format` command line option to `cargo-fmt`.
- Add `-l,--files-with-diff` command line option to `rustfmt`.
- Add `json` emit mode.
- Add `json` emit mode.

### Fixed

Expand Down Expand Up @@ -380,7 +380,7 @@ if toks.eat_token(Token::Word("modify"))? && toks.eat_token(Token::Word("labels"

### Added

- Add new attribute `rustfmt::skip::attributes` to prevent rustfmt
- Add new attribute `rustfmt::skip::attributes` to prevent rustfmt
from formatting an attribute #3665

### Changed
Expand Down
32 changes: 16 additions & 16 deletions Configurations.md
Expand Up @@ -17,27 +17,27 @@ To enable unstable options, set `unstable_features = true` in `rustfmt.toml` or

Below you find a detailed visual guide on all the supported configuration options of rustfmt:

## `array_width`
## `array_width`

Maximum width of an array literal before falling back to vertical formatting.

- **Default value**: `60`
- **Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
- **Stable**: Yes

By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `array_width` will take precedence.
By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `array_width` will take precedence.

See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics)

## `attr_fn_like_width`
## `attr_fn_like_width`

Maximum width of the args of a function-like attributes before falling back to vertical formatting.

- **Default value**: `70`
- **Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
- **Stable**: Yes

By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `attr_fn_like_width` will take precedence.
By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `attr_fn_like_width` will take precedence.

See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics)

Expand Down Expand Up @@ -295,15 +295,15 @@ where
}
```

## `chain_width`
## `chain_width`

Maximum width of a chain to fit on one line.

- **Default value**: `60`
- **Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
- **Stable**: Yes

By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `chain_width` will take precedence.
By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `chain_width` will take precedence.

See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics)

Expand Down Expand Up @@ -751,15 +751,15 @@ trait Lorem {
}
```

## `fn_call_width`
## `fn_call_width`

Maximum width of the args of a function call before falling back to vertical formatting.

- **Default value**: `60`
- **Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
- **Stable**: Yes

By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `fn_call_width` will take precedence.
By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `fn_call_width` will take precedence.

See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics)

Expand Down Expand Up @@ -2124,15 +2124,15 @@ Don't reformat out of line modules
- **Possible values**: `true`, `false`
- **Stable**: No (tracking issue: #3389)

## `single_line_if_else_max_width`
## `single_line_if_else_max_width`

Maximum line length for single line if-else expressions. A value of `0` (zero) results in if-else expressions always being broken into multiple lines. Note this occurs when `use_small_heuristics` is set to `Off`.

- **Default value**: `50`
- **Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
- **Stable**: Yes

By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `single_line_if_else_max_width` will take precedence.
By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `single_line_if_else_max_width` will take precedence.

See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics)

Expand Down Expand Up @@ -2313,27 +2313,27 @@ fn main() {

See also: [`indent_style`](#indent_style).

## `struct_lit_width`
## `struct_lit_width`

Maximum width in the body of a struct literal before falling back to vertical formatting. A value of `0` (zero) results in struct literals always being broken into multiple lines. Note this occurs when `use_small_heuristics` is set to `Off`.

- **Default value**: `18`
- **Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
- **Stable**: Yes

By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `struct_lit_width` will take precedence.
By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `struct_lit_width` will take precedence.

See also [`max_width`](#max_width), [`use_small_heuristics`](#use_small_heuristics), and [`struct_lit_single_line`](#struct_lit_single_line)

## `struct_variant_width`
## `struct_variant_width`

Maximum width in the body of a struct variant before falling back to vertical formatting. A value of `0` (zero) results in struct literals always being broken into multiple lines. Note this occurs when `use_small_heuristics` is set to `Off`.

- **Default value**: `35`
- **Possible values**: any positive integer that is less than or equal to the value specified for [`max_width`](#max_width)
- **Stable**: Yes

By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `struct_variant_width` will take precedence.
By default this option is set as a percentage of [`max_width`](#max_width) provided by [`use_small_heuristics`](#use_small_heuristics), but a value set directly for `struct_variant_width` will take precedence.

See also [`max_width`](#max_width) and [`use_small_heuristics`](#use_small_heuristics)

Expand Down Expand Up @@ -2530,7 +2530,7 @@ fn main() {

This option can be used to simplify the management and bulk updates of the granular width configuration settings ([`fn_call_width`](#fn_call_width), [`attr_fn_like_width`](#attr_fn_like_width), [`struct_lit_width`](#struct_lit_width), [`struct_variant_width`](#struct_variant_width), [`array_width`](#array_width), [`chain_width`](#chain_width), [`single_line_if_else_max_width`](#single_line_if_else_max_width)), that respectively control when formatted constructs are multi-lined/vertical based on width.

Note that explicitly provided values for the width configuration settings take precedence and override the calculated values determined by `use_small_heuristics`.
Note that explicitly provided values for the width configuration settings take precedence and override the calculated values determined by `use_small_heuristics`.

- **Default value**: `"Default"`
- **Possible values**: `"Default"`, `"Off"`, `"Max"`
Expand Down Expand Up @@ -2595,7 +2595,7 @@ fn main() {
```

#### `Off`:
When `use_small_heuristics` is set to `Off`, the granular width settings are functionally disabled and ignored. See the documentation for the respective width config options for specifics.
When `use_small_heuristics` is set to `Off`, the granular width settings are functionally disabled and ignored. See the documentation for the respective width config options for specifics.

```rust
enum Lorem {
Expand Down
2 changes: 1 addition & 1 deletion Contributing.md
Expand Up @@ -38,7 +38,7 @@ colourised diff will be printed so that the offending line(s) can quickly be
identified.

Without explicit settings, the tests will be run using rustfmt's default
configuration. It is possible to run a test using non-default settings in several
configuration. It is possible to run a test using non-default settings in several
ways. Firstly, you can include configuration parameters in comments at the top
of the file. For example: to use 3 spaces per tab, start your test with
`// rustfmt-tab_spaces: 3`. Just remember that the comment is part of the input,
Expand Down
4 changes: 2 additions & 2 deletions Design.md
Expand Up @@ -150,8 +150,8 @@ for its configuration.

Our visitor keeps track of the desired current indent due to blocks (
`block_indent`). Each `visit_*` method reformats code according to this indent,
`config.comment_width()` and `config.max_width()`. Most reformatting that is done
in the `visit_*` methods is a bit hacky and is meant to be temporary until it can
`config.comment_width()` and `config.max_width()`. Most reformatting that is done
in the `visit_*` methods is a bit hacky and is meant to be temporary until it can
be done properly.

There are a bunch of methods called `rewrite_*`. They do the bulk of the
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -180,13 +180,13 @@ needs to be specified in `rustfmt.toml`, e.g., with `edition = "2018"`.

* For things you do not want rustfmt to mangle, use `#[rustfmt::skip]`
* To prevent rustfmt from formatting a macro or an attribute,
use `#[rustfmt::skip::macros(target_macro_name)]` or
use `#[rustfmt::skip::macros(target_macro_name)]` or
`#[rustfmt::skip::attributes(target_attribute_name)]`

Example:

```rust
#![rustfmt::skip::attributes(custom_attribute)]
#![rustfmt::skip::attributes(custom_attribute)]

#[custom_attribute(formatting , here , should , be , Skipped)]
#[rustfmt::skip::macros(html)]
Expand Down
2 changes: 1 addition & 1 deletion ci/integration.sh
Expand Up @@ -15,7 +15,7 @@ set -ex
# it again.
#
#which cargo-fmt || cargo install --force
CFG_RELEASE=nightly CFG_RELEASE_CHANNEL=nightly cargo install --path . --force
CFG_RELEASE=nightly CFG_RELEASE_CHANNEL=nightly cargo install --path . --force

echo "Integration tests for: ${INTEGRATION}"
cargo fmt -- --version
Expand Down
8 changes: 4 additions & 4 deletions docs/index.html
Expand Up @@ -85,7 +85,7 @@
outputHtml() {
const ast = this.configurationDescriptions
.filter(({ head, text, stable }) => {

if (
text.includes(this.searchCondition) === false &&
head.includes(this.searchCondition) === false
Expand All @@ -105,7 +105,7 @@
},
created: async function() {
const res = await axios.get(ConfigurationMdUrl);
const {
const {
about,
configurationAbout,
configurationDescriptions
Expand Down Expand Up @@ -144,7 +144,7 @@
const lastIndex = stack.length - 1;
stack[lastIndex].push(next);
return stack;
},
},
[[]]);
});
}
Expand Down Expand Up @@ -179,7 +179,7 @@
configurationAbout, ...configurationDescriptions
] = configurations;
configurationAbout.value.links = {};

return {
about,
configurationAbout: configurationAbout.value,
Expand Down

0 comments on commit 71f01d1

Please sign in to comment.