Create git-rustfmt crate

This commit is contained in:
topecongiro 2018-02-07 22:49:56 +09:00
parent d28d7fee89
commit 9c9b31c13b
2 changed files with 31 additions and 2 deletions

19
git-rustfmt/Cargo.toml Normal file
View File

@ -0,0 +1,19 @@
[package]
name = "git-rustfmt"
version = "0.4.0"
authors = ["Nicholas Cameron <ncameron@mozilla.com>", "The Rustfmt developers"]
description = "Run rustfmt against git diff"
repository = "https://github.com/rust-lang-nursery/rustfmt"
readme = "README.md"
license = "Apache-2.0/MIT"
categories = ["development-tools"]
[[bin]]
name = "git-rustfmt"
[dependencies]
env_logger = "0.4"
getopts = "0.2"
log = "0.3"
rustfmt-config = { path = "../rustfmt-config" }
rustfmt-core = { path = "../rustfmt-core" }

View File

@ -1,8 +1,19 @@
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
extern crate env_logger;
extern crate getopts;
#[macro_use]
extern crate log;
extern crate rustfmt_nightly as rustfmt;
extern crate rustfmt_config as config;
extern crate rustfmt_core as rustfmt;
use std::env;
use std::path::{Path, PathBuf};
@ -12,7 +23,6 @@ use std::str::FromStr;
use getopts::{Matches, Options};
use rustfmt::{run, Input};
use rustfmt::config;
fn prune_files(files: Vec<&str>) -> Vec<&str> {
let prefixes: Vec<_> = files