Skip to content

Commit

Permalink
Add rustfmt test to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
draivin committed May 20, 2018
1 parent 201b6a6 commit 898bc80
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@ branches:
only:
- master

before-script:
- rustup component add rustfmt-preview
script:
- cargo fmt --all -- --write-mode=check
- cargo test --verbose --target=$target -- --nocapture
9 changes: 5 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ use rustc_target::spec::abi::Abi;
use syntax::ast::{Attribute, Ident, Item, ItemKind, MetaItem, Mod, Name, Ty, VisibilityKind};
use syntax::attr;
use syntax::codemap::Span;
use syntax::edition::Edition;
use syntax::ext::base::SyntaxExtension::{MultiModifier, NormalTT};
use syntax::ext::base::{Annotatable, ExtCtxt, MacEager, MacResult, MultiItemModifier,
TTMacroExpander};
use syntax::ext::base::{
Annotatable, ExtCtxt, MacEager, MacResult, MultiItemModifier, TTMacroExpander,
};
use syntax::feature_gate::AttributeType;
use syntax::ptr::P;
use syntax::tokenstream::TokenStream;
use syntax::edition::Edition;

use std::cell::RefCell;
use std::rc::Rc;
Expand Down Expand Up @@ -57,7 +58,7 @@ pub fn plugin_registrar(reg: &mut Registry) {
allow_internal_unsafe: false,
allow_internal_unstable: false,
unstable_feature: None,
edition: Edition::Edition2015
edition: Edition::Edition2015,
},
);

Expand Down
8 changes: 5 additions & 3 deletions src/util.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use syntax::{ast::{Item, ItemKind, Mod, VisibilityKind},
ptr::P};
use syntax::{
ast::{Item, ItemKind, Mod, VisibilityKind}, ptr::P,
};

pub fn mod_walk(mut m: Mod, item_map: &mut FnMut(Item) -> Item) -> Mod {
m.items = m.items
m.items = m
.items
.into_iter()
.map(|item| {
let mut item = item.into_inner();
Expand Down
2 changes: 1 addition & 1 deletion tests/test_manager.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::io::{BufRead, BufReader, Write};
use std::process::{Command, Stdio};
use std::io::{Write, BufReader, BufRead};
use std::thread::sleep;
use std::time::Duration;

Expand Down

0 comments on commit 898bc80

Please sign in to comment.