Commit Graph

68 Commits

Author SHA1 Message Date
Caleb Cartwright
944fc57e10 tests: ensure min number of system/idempotent tests ran (#3629) 2019-06-16 23:47:22 +09:00
Seiichi Uchida
a4eab17d7c
Fix is_subpath 2019-06-14 19:16:17 +09:00
Ruben Schmidmeister
dbac28b4b4 Use trait to abstract emit modes (#3616) 2019-06-13 06:59:20 +09:00
Seiichi Uchida
47a11cd516
Format modules defined in cfg_attr (#3604) 2019-06-09 09:20:39 +09:00
Seiichi Uchida
e71bffb008
Format modules defined inside cfg_if macro calls (#3600) 2019-06-08 18:47:18 +09:00
Ruben Schmidmeister
8b57668c33
Move macro to separate module 2019-05-17 16:13:46 +02:00
Ruben Schmidmeister
4745cec7f3
Re-use nightly channel macro 2019-05-17 16:07:49 +02:00
Ruben Schmidmeister
fd22c27c47
Allow tests to be run on nightly only 2019-05-17 15:58:01 +02:00
David Alber
bfe5e9c108 Fix condition typo 2019-05-05 11:55:11 -07:00
topecongiro
f8d3aa5908 Add a path to the parent dir of rustfmt.toml as a prefix
Paths users specify in `ignore` configuraiton option is relative to the
directory which contains the rustfmt.toml file. When processing the ignore paths
internally, rustfmt should add a path to the directory as a  prefix since
RealPath passed from libsyntax is a full path.
2019-04-23 08:12:02 +09:00
Ruben Schmidmeister
3dc625c661 Use annotate-snippets for emitting errors (#3507) 2019-04-17 05:33:36 -07:00
rChaser53
34bf13718a Allow specifying glob pattern to ignore config option (#3488) 2019-04-14 03:30:44 -07:00
Matthias Krüger
4352681d62 fix clippy warnings
clippy::needless_return
clippy::redundant_closure
clippy::or_fun_call
clippy::len_zero
clippy::expect_fun_call
clippy::assertions_on_constants
clippy::identity_conversion
clippy::chars_last_cmp
2019-04-11 13:48:13 +02:00
Shotaro Yamada
9fda937779 Remove redundant & 2019-03-29 19:17:50 +09:00
topecongiro
968d30f5d8 Run tests in a thread with larger stack size 2019-03-26 23:35:07 +09:00
rchaser53
bbbc1e86eb refrect topecongiro reviews
- &Vec<syntax::ast::PathSegment> => &[ast::PathSegment]
    - remove unnecessary implements
    - transfer skip logic to inside rewrite_macro
    - fix test
    - use util methods in libsyntax
    - use meta_item_list directly
    - avoid no_entry.rs for test using module system
    - add logic to skip rustfmt::skip::macros only
    - remove base_skip_macro_names
    - remove Rc
    - use clone to append skip_macro_names
2019-03-21 21:45:39 +09:00
Stéphane Campinas
be0ada27f4 Add comment which refers to an issue on nightly-only test
Co-Authored-By: topecongiro <seuchida@gmail.com>
2019-03-17 12:33:18 +09:00
topecongiro
7fc4e418bf Tweak test settings 2019-03-17 12:33:18 +09:00
topecongiro
bde77714e6 Disable self_tests on beta channel 2019-03-17 12:21:57 +09:00
Igor Matuszewski
6b993c8b8b Fix stdin_works... test on Windows 2019-03-04 18:28:25 +01:00
Igor Matuszewski
b3c28dba83 Expose ModifiedLines and implement parsing data from the string output
This moves `Modified{Chunks,Lines}` from `src/formatting.rs` to
`src/rustfmt_diff.rs` and reexports it in `src/lib.rs`.

With this, a conversion from `Vec<Mismatch>` to `ModifiedLines` was implemented
and now this implements complementary `Display` and `FromStr`, which
simplified the previously used `output_modified` function and which allows to
parse the raw data emitted with `EmitMode::ModifiedLines`.
2019-03-04 18:19:30 +01:00
Igor Matuszewski
0437bf7a7d Allow for stdin input in EmitMode::ModifiedLines 2019-03-04 18:19:30 +01: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
Seiichi Uchida
3f6ea7788b
Merge pull request #3240 from Xanewok/parser-panic
Catch possible tokenizer panics
2018-12-18 11:30:08 +09:00
Andreas Jonson
653f3ae636 use the rustfmt function to find the bin
makes it possible to execute the test after a release build
2018-12-14 23:32:25 +01:00
Andreas Jonson
836562baf4 remove deprecated dependency assert_cli 2018-12-14 23:32:08 +01:00
Igor Matuszewski
10b9afa906 Add test asserting we catch Rust parser panics 2018-12-13 13:35:15 +01: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
cd8bb50aea Trim the indentation on macros which heuristically appear to use block-style indentation (#3178) 2018-11-07 17:49:53 +09:00
Nick Cameron
4bb84f6002 Remove NLL feature
And do some refactoring in comments.rs

Closes #3107
2018-10-18 15:39:11 +13:00
Otavio Salvador
2ae1b4804c Enable stdin_disable_all_formatting_test test
Fixes: #1990.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2018-10-09 09:06:16 -03:00
Seiichi Uchida
e2b9c66cc9 Cargo fmt 2018-09-19 23:22:26 +09:00
Matthias Krüger
e058a3f7e7 fix cargo test --release.
test::verify_check_works was failing in relase mode on my machine.

The problem was it would check for target/debug/rustfmt in release mode instead of
target/release/rustfmt and fail an assert.

This commit fixes it so that cargo check looks for target/debug/rustfmt and
cargo check --release looks for target/release/rustfmt
2018-09-06 02:07:09 +02:00
Maximilian Roos
968affc3e0
final clippy changes 2018-09-01 16:32:38 -04:00
cad97
fc1909d311 Reformat 2018-08-23 17:14:19 -04:00
cad97
04d804c365 Rename CodeMap/FileMap to SourceMap/SourceFile
#2946
2018-08-23 17:10:46 -04:00
Nick Cameron
43f178bd58 Remove Summary 2018-07-24 21:45:15 +12:00
Nick Cameron
481e85cc58 formatting 2018-07-24 15:46:39 +12:00
Nick Cameron
2af1ed109c Refactoring: factor out format_file and FormatHandler
This effectively separates out formatting from other handling.
2018-07-24 14:05:04 +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
71d3d04270 factor out a Session object 2018-07-23 15:37:34 +12:00
Nick Cameron
4153e66e42 Move non-public API from lib.rs to its own module 2018-07-23 12:45:41 +12: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
Nick Cameron
486f8fd8e7 Fixup formatting of tests and source 2018-07-12 21:37:28 +12:00
Florian Walch
363363d066 test: Assert CRLF line endings on Windows 2018-07-02 23:43:59 +02:00
Stéphane Campinas
f7a25a1177
warn on use of default value for an option 2018-06-30 17:03:18 +02:00
Tibo Delor
6b00b8b302
Move newline logic inside the formatting process.
Why?:
 - Conceptually it sounds right
 - Absolutely all write modes where doing it anyway
 - It was done several times in some in case
 - It greatly simplify the code
2018-06-10 00:25:47 +10:00
Alex Butler
cd925f0140
Add mercy for devs that run cargo test without building 2018-05-29 00:38:47 +01:00