Commit Graph

234 Commits

Author SHA1 Message Date
Johannes Linke
826eba8984
Add a few missing tracking issues in Configurations.md (#5084)
* Add a few missing tracking issues in Configurations.md

* fix: tracking issue for imports_granularity stabilization

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
2021-11-19 19:22:50 -06:00
Wu Yu Wei
e6d1bf5acb Link tracking issues in Configurations.md (#4096)
# Conflicts:
#	Configurations.md
2021-11-08 19:04:57 -06:00
Martinez
599b2fd9c4
Add One option to group_imports (#4966)
* Add Together option to group_imports

* Rename option to One

* Rename files from Together to One
2021-10-23 11:01:48 -05:00
Caleb Cartwright
c9c1932be3 feat: stabilize disable_all_formatting 2021-10-13 21:58:13 -05:00
Emilio Cobos Álvarez
8b58cce673 Stabilize match_block_trailing_comma. (#4145)
Servo has used this since forever, and it'd be useful to be able to use
rustfmt stable there so that we can use the same rustfmt version in
both Firefox and Servo.

Feel free to close this if there's any reason it shouldn't be done.
2021-10-11 17:16:10 -05:00
Lucas Kent
cb144c35e7 In Configurations.md demonstrate both cases for noop selections 2021-09-25 14:48:20 -05:00
Arjen Laarhoven
9d65b7dcd1 feat: upper- or lowercase hexadecimal literals 2021-09-14 21:22:26 -05:00
Seiichi Uchida
d4ffd1efa4 Support @generated marker to skip code formatting
This is a copy of #4296 with these changes:
* file is not reopened again to find if the file is generated
* first five lines are scanned for `@generated` marker instead of one
* no attempt is made to only search for marker in comments

`@generated` marker is used by certain tools to understand that the
file is generated, so it should be treated differently than a file
written by a human:
* linters should not be invoked on these files,
* diffs in these files are less important,
* and these files should not be reformatted.

This PR proposes builtin support for `@generated` marker.

I have not found a standard for a generated file marker, but:
* Facebook [uses `@generated` marker](https://tinyurl.com/fb-generated)
* Phabricator tool which was spawned from Facebook internal tool
  [also understands `@generated` marker](https://git.io/JnVHa)
* Cargo inserts `@generated` marker into [generated Cargo.lock files](https://git.io/JnVHP)

My personal story is that rust-protobuf project which I maintain
was broken twice because of incompatibilities/bugs in rustfmt marker
handling: [one](https://github.com/stepancheg/rust-protobuf/issues/493),
[two](https://github.com/stepancheg/rust-protobuf/issues/551).
(Also, rust-protobuf started generating `@generated` marker
[6 years ago](https://git.io/JnV5h)).

While rustfmt AST markers are useful to apply to a certain AST
elements, disable whole-file-at-once all-tools-at-once text level
marker might be easier to use and more reliable for generated code.
2021-09-14 21:22:26 -05:00
Yusuke Tanaka
ca9b050bbf Implement One option for imports_granularity (#4669)
This option merges all imports into a single `use` statement as long as
they have the same visibility.
2021-08-31 18:33:06 -05:00
Caleb Cartwright
2cf280ed1b docs: clarify match_arm_blocks config documentation 2021-07-25 22:53:32 -05:00
Alexander Melentyev
71f01d1974 Delete spaces 2021-06-21 12:11:37 +03:00
Caleb Cartwright
0269eb1c5f docs: update configuration info 2021-04-21 21:27:50 -05:00
Michael Morgan
384ba68d64 Add imports_granularity="Item".
This option splits all imports into their own `use` statement.
2021-01-27 20:58:42 -06:00
Geoffry Song
17bad2b3c0 Tweak imports_granularity documentation 2021-01-17 11:48:47 -06:00
Geoffry Song
71863753bd Rename merge_imports to imports_granularity and add a Module option.
This renames the existing `true`/`false` options to `Crate`/`Never`, then adds a
new `Module` option which causes imports to be grouped together by their
originating module.
2021-01-17 11:48:47 -06:00
Mara Bos
398d2f96c3 Add support for edition 2021. 2021-01-09 12:11:52 -06:00
Matt
073cc3891f Option to create groups for std, external crates, and other imports
Backport of 17d90ca.
2020-11-18 21:37:42 -06:00
Caleb Cartwright
f6b96254fb docs: add config info for match_arm_leading_pipes 2020-09-24 09:43:31 -05:00
Caleb Cartwright
62432fe31b add new flag to list names of misformatted files (#3747) 2019-08-19 11:04:40 +09:00
Cliff Dyer
127de25041 sorted configuration docs (#3723) 2019-08-06 11:07:12 +09:00
Caleb Cartwright
1ee51a4125 Add support for windows-style paths in ignore patterns (#3633) 2019-06-29 15:51:27 +09:00
Stéphane Campinas
e6b60a40d5 stabilise fn_args_density (#3581) 2019-06-03 22:26:48 +09:00
Seiichi Uchida
e0664662b4
Update the documentation of ignore (#3580) 2019-05-23 09:43:43 +09:00
xiongmao86
a956a20532 Revert "Revert "Change config option from format_doc_comments to format_code_in_doc_comments.""
This reverts commit 97d7216cd4.
2019-05-10 21:22:52 +08:00
xiongmao86
de425f1eb8 Fix docs in Configurations.md. 2019-05-08 16:56:53 +08:00
xiongmao86
97d7216cd4 Revert "Change config option from format_doc_comments to format_code_in_doc_comments."
This reverts commit 6a6924c12b.
2019-05-08 16:51:32 +08:00
xiongmao86
6a6924c12b Change config option from format_doc_comments to format_code_in_doc_comments. 2019-05-06 19:45:34 +08:00
daxpedda
cfd1811a24
Additional info to default value of edition. 2019-03-13 15:46:34 +01:00
Stéphane Campinas
6a75feedac
Merge pull request #3409 from rchaser53/issue-3343
add config inline_attribute_width
2019-02-23 13:16:23 +01:00
rchaser53
e68044f8bc add a section to Configuration.md
- attributes => attribute
2019-02-23 13:46:32 +09:00
Ben Boeckel
2a353429b6 Configurations: fix typos and mismatches 2019-02-22 14:09:15 -05:00
Stéphane Campinas
2b08b73f56
do not put tracking issue as part of the option's title 2019-02-18 20:35:22 +01:00
Stéphane Campinas
412dcc70a2
point unstable options to tracking issues 2019-02-14 00:11:25 +01:00
Seiichi Uchida
efd6fda43f
Merge pull request #3311 from rchaser53/issue-3295
fix "internal error: left behind trailing whitespace" with long lines
2019-02-04 00:10:42 +09:00
rchaser53
c2534f5324 fix "internal error: left behind trailing whitespace" with long lines 2019-02-01 19:58:38 +09:00
Mara Bos
635a4cdcdc Also look in home directory for global config. 2019-01-27 13:22:25 +01:00
Mara Bos
13db34fb95 Document the global rustfmt.toml feature. 2019-01-27 13:22:25 +01:00
Arnav Borborah
4d87ef76d8
Fix incorrect documentation for unstable_features 2019-01-10 14:54:06 -05:00
Isaac Ng
c4ea1581a1
Fix formatting in Configurations.md
fixes #3230
2018-12-07 14:58:02 +11:00
Lucian
8cd8ab5f4b Fix minor typos and grammar
Signed-off-by: Lucian <lucian.buzzo@gmail.com>
2018-12-06 15:31:43 +00:00
Nick Cameron
378994b858 Add a version option 2018-11-27 14:18:14 +13:00
Kevin Stenerson
7290529b3f Add docs to Configuration guide 2018-11-05 21:50:54 -07:00
Otavio Salvador
9c3ae2d951 Stabilize edition configuration option
Refs: #3104.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2018-10-24 22:49:17 -03:00
Nick Cameron
19d60f8137 Revert "Use width_heuristics in the options docs"
This reverts commit fa3cadf62c.
2018-10-24 15:07:09 +13:00
Nick Cameron
fa3cadf62c
Use width_heuristics in the options docs
It was using an older name
2018-10-23 14:59:14 +13:00
Seiichi Uchida
b2de574848 Add format_doc_comments 2018-10-11 23:34:36 +09:00
Ivan Molodetskikh
cbaed838d5
No trailing comma in struct literals (Visual) 2018-10-06 10:59:47 +03:00
moxian
65ae0b9a09 Change enum align semantics to care about absolute length, rather than difference.
If we're only aligning enum discriminants that are "not too far apart
(length-wise)", then this works really well for enums with
consistently-long or consistently-short idents, but not for the mixed
ones.
However, consistently-long idents is somewhate of an uncommon case and
overlong idents may be allowed to be formatted suboptimally if that
makes mixed-length idents work better (and it does in this case).
2018-09-26 18:47:17 +00:00
moxian
cc22869fb4 Add option to vertically align enum discriminants. 2018-09-26 14:35:38 +00:00
Nick Cameron
1739041f03
Merge pull request #3002 from lqd/normalize-doc-attributes
normalize_doc_attributes option: convert doc attributes to comments
2018-09-19 11:05:27 +12:00