Commit Graph

4955 Commits

Author SHA1 Message Date
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
Caleb Cartwright
bfd479d5af
Merge pull request #4920 from calebcartwright/subtree-sync
subtree sync
2021-07-25 19:50:31 -05:00
Camille GILLOT
277feac1f9 Use LocalExpnId where possible. 2021-07-17 19:41:02 +02:00
Guillaume Gomez
abf449ffa6 Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
Joshua Nelson
33acc960f7 Document rustfmt on nightly-rustc
The recursion_limit attribute avoids the following error:

```
error[E0275]: overflow evaluating the requirement `std::ptr::Unique<rustc_ast::Pat>: std::marker::Send`
  |
  = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`rustfmt_nightly`)
```
2021-07-01 19:39:47 -04:00
Yuki Okushi
0b8a26f507 Rollup merge of #86424 - calebcartwright:rustfmt-mod-resolution, r=Mark-Simulacrum
rustfmt: load nested out-of-line mods correctly

This should address https://github.com/rust-lang/rustfmt/issues/4874

r? `@Mark-Simulacrum`

Decided to make the change directly in tree here for expediency/to minimize any potential backporting issues, and because there's some subtree sync items I need to get resolved before pulling from r-l/rustfmt
2021-06-22 00:00:41 +09:00
Yuki Okushi
d13020cd31 Rollup merge of #86274 - alexander-melentyev:spaces, r=bjorn3
Spaces
2021-06-22 00:00:38 +09:00
Alexander Melentyev
71f01d1974 Delete spaces 2021-06-21 12:11:37 +03:00
Caleb Cartwright
2608f2c63b fix(rustfmt): load nested out-of-line mods correctly 2021-06-17 22:35:19 -05:00
Yuki Okushi
1e2258ffa9 Use AttrVec for Arm, FieldDef, and Variant 2021-06-17 08:04:54 +09:00
Ryan Levick
58c63cf8de Add support for using qualified paths with structs in expression and pattern
position.
2021-06-10 13:18:41 +02:00
jedel1043
e243be6ada Allow formatting Anonymous{Struct, Union} declarations 2021-05-16 22:13:38 -05:00
Joshua Nelson
d67f1a48ef Update log to 0.4.14
This avoids the following warning:

```
warning: trailing semicolon in macro used in expression position
   --> /home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.11/src/macros.rs:152:45
    |
147 | / macro_rules! debug {
148 | |     (target: $target:expr, $($arg:tt)+) => (
149 | |         log!(target: $target, $crate::Level::Debug, $($arg)+);
150 | |     );
151 | |     ($($arg:tt)+) => (
152 | |         log!($crate::Level::Debug, $($arg)+);
    | |                                             ^
153 | |     )
154 | | }
    | |_- in this expansion of `debug!`
    |
   ::: src/tools/rustfmt/src/modules/visitor.rs:36:23
    |
36  |               Err(e) => debug!("{}", e),
    |                         --------------- in this macro invocation
    |
    = note: requested on the command line with `-W semicolon-in-expressions-from-macros`
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #79813 <https://github.com/rust-lang/rust/issues/79813>
```
2021-05-14 21:54:43 -05:00
Caleb Cartwright
7872306edf chore: update gitattributes for files with windows style line endings 2021-05-14 18:50:25 -05:00
Andy Wang
927561ace1 Bump nightly version 2021-05-12 22:12:43 -05:00
Andy Wang
ef31361766 Rename RealFileName::Named to LocalPath 2021-05-12 22:12:43 -05:00
Andy Wang
e4b5621b0e Only deal with LocalPath in conversion 2021-05-12 22:12:43 -05:00
Andy Wang
8526acee21 Rename span_to_string to span_to_diagnostic_string 2021-05-12 22:12:43 -05:00
Caleb Cartwright
2a3635d5d1 tests: remove snippets with inner attrs on non-block expressions 2021-05-04 18:38:22 -05:00
Caleb Cartwright
f87414729f fix: backport changes for latest rustc api comaptibility 2021-05-02 10:37:43 -05:00
Yuki Okushi
ddb224a173
Upgrade annotate-snippets to 0.8 (#4762) 2021-04-22 08:33:36 -05:00
ChinYing-Li
84ff0013c2 Add the case in duplicate issue (#4806) to the idempotent tests 2021-04-21 21:30:42 -05:00
ChinYing-Li
dac2423f3f Recognize when a block comment has been ended inside a string literal (#4312) 2021-04-21 21:30:42 -05:00
Joseph Birr-Pixton
58157bb4b7 Add some basic tests for chain_width use 2021-04-21 21:27:50 -05:00
Caleb Cartwright
78b0728887 refactor: remove panics on misconfigured widths 2021-04-21 21:27:50 -05:00