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.
- &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
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`.
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
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
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