Commit graph

4979 commits

Author SHA1 Message Date
Laurențiu Nicola
67a59f6ee3 opts: rephrase wording for --all and -p 2021-09-13 18:57:31 -05:00
Nipunn Koorapati
b10ab51fed rustfmt doc code blocks with multiple comma-separated attributes
Added test covering this. Chose to treat the code block
as rust if and only if all of the comma-separated attributes
are rust-valid. Chose to allow/preserve whitespace around commas

Fixes #3158
2021-09-08 23:27:51 -05:00
Caleb Cartwright
a80688329c fix: handle param doc comments for macro scenarios 2021-09-08 19:27:31 -05:00
Caleb Cartwright
57548aa096 fix: resolve idempotency issue in extern body elements 2021-09-07 20:22:09 -05:00
Caleb Cartwright
3d8cd57c2f tests: add files for issue 4579 2021-09-06 18:14:13 -05:00
Stéphane Campinas
c2f0e99d85 try to write the parameter on a new line in case the attribute/parameter together are over max_width 2021-09-06 18:14:13 -05:00
Caleb Cartwright
a59cac29f4 fix: use correct spans for params with attrs 2021-09-06 18:14:13 -05:00
Caleb Cartwright
59063e8b40 fix: newline width calc in combine w/ comments (#4123) 2021-09-06 17:02:20 -05:00
Eric
ae5696a7c4 test: add test for #4322 2021-09-02 20:53:15 -05:00
Eric
bfc60466bd test: add test for #4954 2021-09-02 20:53:15 -05:00
Eric
33d1368674 test: add test for #4257 2021-09-02 20:53:15 -05:00
Eric
d19f69cd71 test: add missing source for #4943 2021-09-02 20:53:15 -05:00
Akiomi Kamakura
c71c68c43f Add <title> to docs 2021-09-01 21:59:58 -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
Ashvin Arsakularatne
e81c393663 fix: remove wrong reformatting of qualified paths in struct patterns 2021-08-25 21:18:41 -05:00
David Tolnay
fd6b025e8a Preserve visibility on trait items inside trait and impl 2021-08-22 12:06:18 -05:00
David Tolnay
c8bd550c8d Add test for visibility on a trait item (currently wrong) 2021-08-22 12:06:18 -05:00
David Bar-On
f7872887e9 Fix for version config option anchor 2021-08-17 21:55:26 -05:00
gunadhya
ec86cfd6ba Fix redirect issue
Signed-off-by: gunadhya <6939749+gunadhya@users.noreply.github.com>
2021-08-17 21:55:26 -05:00
gunadhya
042c2ec369 Added Updated default version to Rustfmt docs config 2021-08-17 21:55:26 -05:00
jdollar
3c36a0c0b7 Exluding v0.8.1 and v0.7 from the config dropdown
Older tags of the repo don't have the configuration.md file
that the docs/index.html file uses to display configuration options.
Removing them from the list since they don't apply to the use case of the
documentation page.
2021-08-17 21:55:26 -05:00
Ayaz Hafiz
5c7ac69393 Warn when rate limit is on docs page
Demo: https://5f0fad2f06c62143ac519413--festive-golick-afb5e0.netlify.app
2021-08-17 21:55:26 -05:00
Ayaz Hafiz
f5c782f321 fixup! Ensure that doc url hash IDs are scrolled to on page load 2021-08-17 21:55:26 -05:00
Ayaz Hafiz
bf47fc17a3 Ensure that doc url hash IDs are scrolled to on page load
I broke this a few weeks ago so I'll fix it

Demo: https://5f0fa445faca4aff5f580029--naughty-borg-09b903.netlify.app/?version=master&search=#brace_style
2021-08-17 21:55:26 -05:00
Ayaz Hafiz
3195d6c2b7 docs: Preserve updated query param content and add config option links
- Preserve search and version parameter updates in the url
- Render headings with an anchor to itself for easier linking to config
  options, variants, etc.

Demo: https://5efeb81ca3f0d.htmlsave.net/
2021-08-17 21:55:26 -05:00
asrar
31c97ce0f0 Adds query param for version no (#4270)
* Adds query param for version no

This adds support for using a query parameter for selecting the version no

* Adds error handling to configuration request

Catch request exception in case fetching the configuration from the url fails, this can happen either if non existent version number is passed in or because of server issues.

* Makes version selection better

Covers a few common cases in which the version number can be specified.
2021-08-17 21:55:26 -05:00
asrar
c5f1d9698e Adds direct linking using header ids (#4272)
Separates out search and direct linking, uses header ids for direct linking and `?search=term` for filtering configurations.
Once the app mounts the page is scrolled to the current header set in the url hash.
2021-08-17 21:55:26 -05:00
hafiz
1045c62ac1 Add github-style highlighting for code blocks (#4224) 2021-08-17 21:55:26 -05:00
Ayaz Hafiz
916c238103 fixup! Show configs from different versions on github pages 2021-08-17 21:55:26 -05:00
Ayaz Hafiz
6959d03a3a Show configs from different versions on github pages
See https://gushiermainecoon.htmlpasta.com/ for a demo of this change.

Part of #4178
2021-08-17 21:55:26 -05:00
Ayaz Hafiz
667a2da7af Fix stable toggle on gh pages configuration site
A demonstration of the fix is included in the PR associated with this
commit.
2021-08-17 21:55:26 -05:00
Nipunn Koorapati
1d6002ae38 Enable triagebot assignment in rustfmt 2021-08-09 17:56:41 -05:00
Caleb Cartwright
5d8eb8d79c fix: don't drop drop generic args on assoc ty constraints 2021-08-08 13:58:10 -05:00
Caleb Cartwright
fefb5427a2 fix: handle GAT types in impls with self bounds 2021-08-06 22:03:40 -05:00
Caleb Cartwright
8cbee5604a ci: functionally delete appveyor 2021-07-29 22:07:50 -05:00
klensy
8c52aae10a Bump deps
* dirs-sys v0.3.4 -> v0.3.6 to drop a lot of deps
regex v1.3.1 -> v1.4.3 drops thread_local 0.3.6
bytecount v0.6.0 -> v0.6.2 replaces packed_simd with packed_simd_2
ignore v0.4.11 -> v0.4.17 drop crossbeam-channel v0.4.0

* itertools 8.0 -> 9.0
bump `ignore` version in Cargo.toml

* cargo_metadata 0.8 -> 0.12

* env_logger 0.6 -> 0.8
2021-07-27 19:50:11 -05:00
Ellen
0b21ea2161 Unyeet const param defaults 2021-07-27 19:50:11 -05:00
Outvi V
e7fa07036f fix: make --edition 2021 visible in --help 2021-07-27 19:50:11 -05:00
Caleb Cartwright
778f03530f ci: remove unnecessary cargo-make install on windows jobs 2021-07-26 22:00:01 -05:00
Caleb Cartwright
4236289b75 chore: bump toolchain 2021-07-25 22:53:32 -05:00
Elliot Bobrow
0832137b9e fix link in Contributing.md 2021-07-25 22:53:32 -05:00
Caleb Cartwright
d42be80bf7 chore: disable clippy::matches_like_macro lint 2021-07-25 22:53:32 -05:00
Matthias Krüger
4c2959fb12 fix a bunch of clippy warnings
clippy::bind_instead_of_map
clippy::branches_sharing_code
clippy::collapsible_match
clippy::inconsistent_struct_constructor
clippy::int_plus_one
clippy::iter_count
clippy::iter_nth_zero
clippy::manual_range_contains
clippy::match_like_matches_macro
clippy::needless::collect
clippy::needless_question_mark
clippy::needless_return
clippy::op_ref
clippy::option_as_ref_deref
clippy::ptr_arg
clippy::redundant_clone
clippy::redundant_closure
clippy::redundant_static_lifetimes
clippy::search_is_some
clippy::#single_char_add_str
clippy::single_char_pattern
clippy::single_component_path_imports
clippy::single_match
clippy::skip_while_next
clippy::unnecessary_lazy_evaluations
clippy::unnecessary_unwrap
clippy::useless_conversion
clippy::useless_format
2021-07-25 22:53:32 -05:00
Caleb Cartwright
2cf280ed1b docs: clarify match_arm_blocks config documentation 2021-07-25 22:53:32 -05:00
Jethro Beekman
19733f19f1 Change line endings from CRLF to LF 2021-07-25 22:53:32 -05:00
Caleb Cartwright
b305d62e5b fix: correct arm leading pipe check (#4880)
In the event a pattern starts with a leading pipe
the pattern span will contain, and begin with, the pipe.

This updates the process to see if a match arm contains
a leading pipe by leveraging this recent(ish) change to
the patterns in the AST, and avoids an indexing bug that
occurs when a pattern starts with a non-ascii char in the
old implementation.
2021-07-25 22:53:32 -05:00
Michael Murphy
e634a6f9a8 Updating outdated links (#4869)
* Updating outdated links

Updating the links to the docs and source code for `ast.rs`. Seems like it was moved to a new crate at some point.

* Updating more outdated links

This time, the links to the `fmt-rfcs` repository, which is now owned by
`rust-dev-tools` (although GitHub was redirecting anyway).

* Update Contributing.md

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>

Co-authored-by: Caleb Cartwright <calebcartwright@users.noreply.github.com>
2021-07-25 22:53:32 -05:00
Michael Murphy
486e774fbf Adjusting help message (#4865)
On stable, running with `--help|-h` shows information about `file-lines`
which is a nightly-only option. This commit removes all mention of
`file-lines` from the help message on stable.

There is room for improvement here; perhaps a new struct called, e.g.,
`StableOptions` could be added to complement the existing
`GetOptsOptions` struct. `StableOptions` could have a field for each
field in `GetOptsOptions`, with each field's value being a `bool` that
specifies whether or not the option exists on stable. Or is this adding
too much complexity?
2021-07-25 22:53:32 -05:00
Casey Rodarmor
1ca3798d2c Improve pasta copyability of merge_imports deprecation message
Add double quotes around `Crate` so that it can be copied directly into a `Cargo.toml` file
2021-07-25 22:53:32 -05:00
Ruby Lazuli
75765f656e Allow --edition 2021 to be passed to rustfmt
This was added to Configurations.md in #4618, but the option wasn't
actually made available. This should let people who are using Rust 2021
on nightly rustc run `cargo fmt` again.
2021-07-25 22:53:32 -05:00