132 Commits

Author SHA1 Message Date
topecongiro
0d67db4744 Move some code out of create_config 2019-03-24 23:36:07 +09:00
Seiichi Uchida
ce5cccc32c
Update rustc-ap-* crates to 407.0.0 (#3447) 2019-03-14 22:50:53 +09:00
rchaser53
0e408bf83c add config inline_attribute_width
If the line width is width within config width, attribute is inline.
I don't want to change default rustfmt behavior, so config default value is 0.

- fix description
- fix test comment
- remove unnecessary clone
- remove unnecessary test file
- fix test for β version
- attributes => attribute
2019-02-23 13:40:11 +09:00
Alexander Regueiro
7a3b7c9275 Various cosmetic improvements (#3403) 2019-02-19 11:56:42 +09:00
Hirokazu Hata
4bb90f5cc8 Fix rust_2018_idioms warnings 2019-02-09 16:14:30 +09:00
Evgenii
ece629b1cc transition to Rust 2018 2019-02-04 13:30:43 +03:00
Mara Bos
635a4cdcdc Also look in home directory for global config. 2019-01-27 13:22:25 +01:00
Mara Bos
24daa174ca Look for a global rustfmt.toml.
If no rustfmt.toml is found in the usual way, the directory 'rustfmt' in
the user's config directory is checked.

 - $XDG_CONFIG_HOME/rustfmt/ (or $HOME/.config/rustfmt/), or
 - $HOME/Library/Preferences/rustfmt/ on Mac, or
 - %AppData%\rustfmt\ on Windows.
2019-01-27 13:22:25 +01:00
Stéphane Campinas
d03d9a45ef
end expressions like return/continue/break with a semicolon
Close #3213
2018-11-29 20:39:07 +01:00
Nick Cameron
378994b858 Add a version option 2018-11-27 14:18:14 +13:00
Nick Cameron
b9f4624ca6 fixup minor bugs 2018-11-19 14:09:29 +13:00
Matthias Krüger
3aa153398a fix a few clippy warnings
types.rs:
fix single_char_pattern (use character patters instead of string for .ends_with() and .starts_with()

patterns.rs
expr.rs
file_lines.rs:
fix into_iter_on_ref_ptr (use iter() or iter_mut() instead of into_iter()

tests/mod.rs:
check_files(): take Option<PathBuf> by reference
2018-11-16 22:25:33 +01:00
Kevin Stenerson
25b828d35f Add config option to more aggressively allow overflow 2018-11-05 21:12:40 -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
Otavio Salvador
584d871494 config: use 2015 as default Edition
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2018-10-23 02:33:33 -03:00
Matthias Krüger
b25f974c0d fix a few typos found via codespell. 2018-10-19 12:28:00 +02:00
Nick Cameron
613dfcc521 Remove various feature flags 2018-10-18 15:38:57 +13:00
Shotaro Yamada
6c964fd030 Reduce allocations 2018-10-15 23:59:08 +09:00
Otavio Salvador
5d4ed07f1c config: replace .unwrap_or with .map_or
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2018-10-12 20:21:48 -03:00
Nick Cameron
8b709c0019 Add attr_fn_like_width to the width heuristics
It is a bit larger than than `fn_call_width` which we used previously, so fewer attributes get reformatted.

Closes #2929
2018-10-12 15:20:42 +13:00
Seiichi Uchida
b2de574848 Add format_doc_comments 2018-10-11 23:34:36 +09:00
Otavio Salvador
0279b7d02c Replace isatty crate with atty
The `isatty` crate has been deprecated and a replacement has been
released for it called `atty`. It offers a nicer API and the code
change to adapt is trivial.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2018-10-08 14:39:16 -03:00
Seiichi Uchida
4a15875f07 Add a test for #3003
and run cargo fmt.
2018-09-30 23:28:03 +09:00
Nick Cameron
4c1b0c2241
Merge pull request #3061 from mehcode/feature/default-edition
Fix help message for edition config option
2018-09-28 21:54:29 +12:00
Ryan Leckey
c7377c3555 Fix help message for edition config option 2018-09-27 22:31:17 -07:00
moxian
cc22869fb4 Add option to vertically align enum discriminants. 2018-09-26 14:35:38 +00:00
Seiichi Uchida
e2b9c66cc9 Cargo fmt 2018-09-19 23:22:26 +09: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
Rémy Rakic
9f6cf7b72c move config attribute 2018-09-13 00:37:31 +02:00
Ivan Molodetskikh
838df8dfb6
Use correct heuristic for match block flattening 2018-09-11 08:54:43 +03:00
lqd
4b7130dfa1 normalize_doc_attributes option: convert doc attributes to comments
Convert `#![doc]` and `#[doc]` attributes to `//!` and `///` doc comments.
2018-09-07 21:58:35 +02:00
Nick Cameron
2291be7fa1
Merge pull request #2992 from max-sixty/clippy2
Clippy 2/2
2018-09-03 13:25:35 +12:00
Maximilian Roos
968affc3e0
final clippy changes 2018-09-01 16:32:38 -04:00
Ryan Leckey
eec74360dc Accept 2015 and 2018 instead of Edition2015 and Edition2018 for edition option 2018-08-31 00:04:23 -07:00
Maximilian Roos
df72570b58
set of clippy changes 2018-08-28 00:33:51 -04:00
Nick Cameron
454a20ac01
Merge pull request #2948 from CAD97/patch-2
Consider "dev" as nightly for feature (un)gating
2018-08-27 09:23:16 +12:00
Maximilian Roos
10512a59d0 Impl only use (#2951) 2018-08-24 14:39:05 +09:00
cad97
04d804c365 Rename CodeMap/FileMap to SourceMap/SourceFile
#2946
2018-08-23 17:10:46 -04:00
Christopher Durham
8cc4200b7d
Consider "dev" as nightly for feature (un)gating 2018-08-23 04:28:44 -04:00
Igor Matuszewski
9d52940dbe Run cargo fmt 2018-08-14 23:23:00 +02:00
Igor Matuszewski
38361c05bc Make file_lines_to_json test deterministic 2018-08-14 23:22:09 +02:00
Igor Matuszewski
4604f46ce8 Expose FileLines JSON representation 2018-08-14 13:33:58 +02:00
Aaron Loucks
dab572e0b0 Increase capacity for newline conversion buffer 2018-07-30 23:19:46 -04:00
Aaron Loucks
6ff2a5e0f3 Auto-detect newline style by default 2018-07-29 10:12:31 -04:00
Nick Cameron
481e85cc58 formatting 2018-07-24 15:46:39 +12:00
Nick Cameron
069c4fc508 Refactoring: summary
Move the timer from Summary to Session.

Move Summary from config to formatting.
2018-07-24 08:43:30 +12:00
Nick Cameron
90c5792565 Set rustfmt-format_macro_matchers to false by default
cc #2543
2018-07-18 12:09:50 +12:00
Nick Cameron
79c5ee8b42 Add config options for formatting macro matchers and bodies
Closes #2753
2018-07-18 12:03:59 +12:00
Michael Bebenita
c2ae39e77a Add max_width option for all heuristics.
This is useful when working with very small max_widths like 79 chars.
2018-07-17 13:17:36 -04:00
Nick Cameron
d911b640d1
Merge pull request #2823 from fwalch/default-newline-style
Change default newline style to "Native"
2018-07-17 11:18:10 +12:00