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

Remove some unstable config options that've been deprecated #5357

Merged
merged 4 commits into from
May 30, 2022
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
49 changes: 0 additions & 49 deletions Configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -1473,26 +1473,6 @@ use core::slice;
#[cfg(feature = "alloc")] use core::slice;
```

## `license_template_path`

Check whether beginnings of files match a license template.

- **Default value**: `""`
- **Possible values**: path to a license template file
- **Stable**: No (tracking issue: [#3352](https://github.com/rust-lang/rustfmt/issues/3352))

A license template is a plain text file which is matched literally against the
beginning of each source file, except for `{}`-delimited blocks, which are
matched as regular expressions. The following license template therefore
matches strings like `// Copyright 2017 The Rust Project Developers.`, `//
Copyright 2018 The Rust Project Developers.`, etc.:

```
// Copyright {\d+} The Rust Project Developers.
```

`\{`, `\}` and `\\` match literal braces / backslashes.

## `match_arm_blocks`

Controls whether arm bodies are wrapped in cases where the first line of the body cannot fit on the same line as the `=>` operator.
Expand Down Expand Up @@ -2168,35 +2148,6 @@ mod sit;
**Note** `mod` with `#[macro_export]` will not be reordered since that could change the semantics
of the original source code.

## `report_fixme`

Report `FIXME` items in comments.

- **Default value**: `"Never"`
- **Possible values**: `"Always"`, `"Unnumbered"`, `"Never"`
- **Stable**: No (tracking issue: [#3394](https://github.com/rust-lang/rustfmt/issues/3394))

Warns about any comments containing `FIXME` in them when set to `"Always"`. If
it contains a `#X` (with `X` being a number) in parentheses following the
`FIXME`, `"Unnumbered"` will ignore it.

See also [`report_todo`](#report_todo).


## `report_todo`

Report `TODO` items in comments.

- **Default value**: `"Never"`
- **Possible values**: `"Always"`, `"Unnumbered"`, `"Never"`
- **Stable**: No (tracking issue: [#3393](https://github.com/rust-lang/rustfmt/issues/3393))

Warns about any comments containing `TODO` in them when set to `"Always"`. If
it contains a `#X` (with `X` being a number) in parentheses following the
`TODO`, `"Unnumbered"` will ignore it.

See also [`report_fixme`](#report_fixme).

## `required_version`

Require a specific version of rustfmt. If you want to make sure that the
Expand Down
22 changes: 0 additions & 22 deletions src/config/config_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ macro_rules! create_config {
#[derive(Clone)]
#[allow(unreachable_pub)]
pub struct Config {
// if a license_template_path has been specified, successfully read, parsed and compiled
// into a regex, it will be stored here
pub license_template: Option<Regex>,
// For each config item, we store a bool indicating whether it has
// been accessed and the value, and a bool whether the option was
// manually initialised, or taken from the default,
Expand Down Expand Up @@ -104,7 +101,6 @@ macro_rules! create_config {
| "struct_variant_width"
| "array_width"
| "chain_width" => self.0.set_heuristics(),
"license_template_path" => self.0.set_license_template(),
"merge_imports" => self.0.set_merge_imports(),
&_ => (),
}
Expand Down Expand Up @@ -163,7 +159,6 @@ macro_rules! create_config {
}
)+
self.set_heuristics();
self.set_license_template();
self.set_ignore(dir);
self.set_merge_imports();
self
Expand Down Expand Up @@ -247,7 +242,6 @@ macro_rules! create_config {
| "struct_variant_width"
| "array_width"
| "chain_width" => self.set_heuristics(),
"license_template_path" => self.set_license_template(),
"merge_imports" => self.set_merge_imports(),
&_ => (),
}
Expand Down Expand Up @@ -386,21 +380,6 @@ macro_rules! create_config {
};
}

fn set_license_template(&mut self) {
if self.was_set().license_template_path() {
let lt_path = self.license_template_path();
if lt_path.len() > 0 {
match license::load_and_compile_template(&lt_path) {
Ok(re) => self.license_template = Some(re),
Err(msg) => eprintln!("Warning for license template file {:?}: {}",
lt_path, msg),
}
} else {
self.license_template = None;
}
}
}

fn set_ignore(&mut self, dir: &Path) {
self.ignore.2.add_prefix(dir);
}
Expand Down Expand Up @@ -437,7 +416,6 @@ macro_rules! create_config {
impl Default for Config {
fn default() -> Config {
Config {
license_template: None,
$(
$i: (Cell::new(false), false, $def, $stb),
)+
Expand Down
265 changes: 0 additions & 265 deletions src/config/license.rs

This file was deleted.

Loading