From af196a956134edc2093cf8fd2bea3a476135b8e4 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 16 Apr 2019 17:27:55 -0600 Subject: [PATCH] fix: Settle on a name? --- CONTRIBUTING.md | 10 +++++----- Cargo.lock | 42 +++++++++++++++++++++--------------------- Cargo.toml | 10 +++++----- README.md | 16 ++++++++-------- benches/corrections.rs | 6 +++--- benches/file.rs | 24 ++++++++++++------------ benches/tokenize.rs | 12 ++++++------ src/main.rs | 14 +++++++------- 8 files changed, 67 insertions(+), 67 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 19e8a65..02d2f4b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,4 @@ -# Contributing to scorrect +# Contributing to defenestrate Thanks for wanting to contribute! There are many ways to contribute and we appreciate any level you're willing to do. @@ -61,7 +61,7 @@ When we're ready to release, a project owner should do the following - `git push upstream master --tag v..` - Run `cargo publish` (run `cargo login` first if needed) -[issues]: https://github.com/crate-ci/scorrect/issues -[new issue]: https://github.com/crate-ci/scorrect/issues/new -[all issues]: https://github.com/crate-ci/scorrect/issues?utf8=%E2%9C%93&q=is%3Aissue -[travis]: https://github.com/crate-ci/scorrect/blob/master/.travis.yml +[issues]: https://github.com/crate-ci/defenestrate/issues +[new issue]: https://github.com/crate-ci/defenestrate/issues/new +[all issues]: https://github.com/crate-ci/defenestrate/issues?utf8=%E2%9C%93&q=is%3Aissue +[travis]: https://github.com/crate-ci/defenestrate/blob/master/.travis.yml diff --git a/Cargo.lock b/Cargo.lock index 9e42097..5199bfe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -141,6 +141,27 @@ dependencies = [ "memchr 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "defenestrate" +version = "0.1.0" +dependencies = [ + "assert_fs 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)", + "csv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "grep-searcher 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ignore 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "phf 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)", + "structopt 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "difference" version = "2.0.0" @@ -612,27 +633,6 @@ name = "scopeguard" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "scorrect" -version = "0.1.0" -dependencies = [ - "assert_fs 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", - "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)", - "csv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "grep-searcher 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "ignore 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "phf 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", - "phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.85 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.36 (registry+https://github.com/rust-lang/crates.io-index)", - "structopt 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "semver" version = "0.9.0" diff --git a/Cargo.toml b/Cargo.toml index 7df1a9a..367c685 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "scorrect" +name = "defenestrate" version = "0.1.0" authors = ["Ed Page "] description = "Source Code Spelling Correction" -repository = "https://github.com/crate-ci/scorrect" -documentation = "https://docs.rs/scorrect" +repository = "https://github.com/crate-ci/defenestrate" +documentation = "https://docs.rs/defenestrate" readme = "README.md" categories = ["development-tools", "text-processing"] keywords = ["development", "spelling"] @@ -12,8 +12,8 @@ license = "MIT" edition = "2018" [badges] -travis-ci = { repository = "crate-ci/scorrect" } -appveyor = { repository = "epage/scorrect" } +travis-ci = { repository = "crate-ci/defenestrate" } +appveyor = { repository = "epage/defenestrate" } [dependencies] failure = "0.1" diff --git a/README.md b/README.md index 283efc2..a066c7d 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# scorrect +# defenestrate > **Source Code Spelling Correction** -[![Travis Status](https://travis-ci.org/crate-ci/scorrect.svg?branch=master)](https://travis-ci.org/crate-ci/scorrect) -[![Appveyor Status](https://ci.appveyor.com/api/projects/status/ngaynop65qg5sqpq/branch/master?svg=true)](https://ci.appveyor.com/project/epage/scorrect/branch/master) +[![Travis Status](https://travis-ci.org/crate-ci/defenestrate.svg?branch=master)](https://travis-ci.org/crate-ci/defenestrate) +[![Appveyor Status](https://ci.appveyor.com/api/projects/status/ngaynop65qg5sqpq/branch/master?svg=true)](https://ci.appveyor.com/project/epage/defenestrate/branch/master) [![Documentation](https://img.shields.io/badge/docs-master-blue.svg)][Documentation] -![License](https://img.shields.io/crates/l/scorrect.svg) -[![Crates Status](https://img.shields.io/crates/v/scorrect.svg)](https://crates.io/crates/scorrect) +![License](https://img.shields.io/crates/l/defenestrate.svg) +[![Crates Status](https://img.shields.io/crates/v/defenestrate.svg)](https://crates.io/crates/defenestrate) ## Install @@ -14,7 +14,7 @@ Add to your `Cargo.toml`: ```toml [dependencies] -scorrect = "0.3" +defenestrate = "0.3" ``` ## License @@ -33,5 +33,5 @@ submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. -[Crates.io]: https://crates.io/crates/scorrect -[Documentation]: https://docs.rs/scorrect +[Crates.io]: https://crates.io/crates/defenestrate +[Documentation]: https://docs.rs/defenestrate diff --git a/benches/corrections.rs b/benches/corrections.rs index bade620..e77cdef 100644 --- a/benches/corrections.rs +++ b/benches/corrections.rs @@ -4,19 +4,19 @@ extern crate test; #[bench] fn load_corrections(b: &mut test::Bencher) { - b.iter(|| scorrect::Dictionary::new()); + b.iter(|| defenestrate::Dictionary::new()); } #[bench] fn correction(b: &mut test::Bencher) { - let corrections = scorrect::Dictionary::new(); + let corrections = defenestrate::Dictionary::new(); assert_eq!(corrections.correct_str("successs"), Some("successes")); b.iter(|| corrections.correct_str("successs")); } #[bench] fn no_correction(b: &mut test::Bencher) { - let corrections = scorrect::Dictionary::new(); + let corrections = defenestrate::Dictionary::new(); assert_eq!(corrections.correct_str("success"), None); b.iter(|| corrections.correct_str("success")); } diff --git a/benches/file.rs b/benches/file.rs index 3056489..a0fd8a2 100644 --- a/benches/file.rs +++ b/benches/file.rs @@ -12,8 +12,8 @@ fn process_empty(b: &mut test::Bencher) { let sample_path = temp.child("sample"); sample_path.write_str(data::EMPTY).unwrap(); - let corrections = scorrect::Dictionary::new(); - b.iter(|| scorrect::process_file(sample_path.path(), &corrections, scorrect::report::print_silent)); + let corrections = defenestrate::Dictionary::new(); + b.iter(|| defenestrate::process_file(sample_path.path(), &corrections, defenestrate::report::print_silent)); temp.close().unwrap(); } @@ -24,8 +24,8 @@ fn process_no_tokens(b: &mut test::Bencher) { let sample_path = temp.child("sample"); sample_path.write_str(data::NO_TOKENS).unwrap(); - let corrections = scorrect::Dictionary::new(); - b.iter(|| scorrect::process_file(sample_path.path(), &corrections, scorrect::report::print_silent)); + let corrections = defenestrate::Dictionary::new(); + b.iter(|| defenestrate::process_file(sample_path.path(), &corrections, defenestrate::report::print_silent)); temp.close().unwrap(); } @@ -36,8 +36,8 @@ fn process_single_token(b: &mut test::Bencher) { let sample_path = temp.child("sample"); sample_path.write_str(data::SINGLE_TOKEN).unwrap(); - let corrections = scorrect::Dictionary::new(); - b.iter(|| scorrect::process_file(sample_path.path(), &corrections, scorrect::report::print_silent)); + let corrections = defenestrate::Dictionary::new(); + b.iter(|| defenestrate::process_file(sample_path.path(), &corrections, defenestrate::report::print_silent)); temp.close().unwrap(); } @@ -48,8 +48,8 @@ fn process_sherlock(b: &mut test::Bencher) { let sample_path = temp.child("sample"); sample_path.write_str(data::SHERLOCK).unwrap(); - let corrections = scorrect::Dictionary::new(); - b.iter(|| scorrect::process_file(sample_path.path(), &corrections, scorrect::report::print_silent)); + let corrections = defenestrate::Dictionary::new(); + b.iter(|| defenestrate::process_file(sample_path.path(), &corrections, defenestrate::report::print_silent)); temp.close().unwrap(); } @@ -60,8 +60,8 @@ fn process_code(b: &mut test::Bencher) { let sample_path = temp.child("sample"); sample_path.write_str(data::CODE).unwrap(); - let corrections = scorrect::Dictionary::new(); - b.iter(|| scorrect::process_file(sample_path.path(), &corrections, scorrect::report::print_silent)); + let corrections = defenestrate::Dictionary::new(); + b.iter(|| defenestrate::process_file(sample_path.path(), &corrections, defenestrate::report::print_silent)); temp.close().unwrap(); } @@ -72,8 +72,8 @@ fn process_corpus(b: &mut test::Bencher) { let sample_path = temp.child("sample"); sample_path.write_str(data::CORPUS).unwrap(); - let corrections = scorrect::Dictionary::new(); - b.iter(|| scorrect::process_file(sample_path.path(), &corrections, scorrect::report::print_silent)); + let corrections = defenestrate::Dictionary::new(); + b.iter(|| defenestrate::process_file(sample_path.path(), &corrections, defenestrate::report::print_silent)); temp.close().unwrap(); } diff --git a/benches/tokenize.rs b/benches/tokenize.rs index aeca216..300ab46 100644 --- a/benches/tokenize.rs +++ b/benches/tokenize.rs @@ -6,30 +6,30 @@ mod data; #[bench] fn tokenize_empty(b: &mut test::Bencher) { - b.iter(|| scorrect::identifier::tokenize(data::EMPTY.as_bytes()).collect::>()); + b.iter(|| defenestrate::identifier::tokenize(data::EMPTY.as_bytes()).collect::>()); } #[bench] fn tokenize_no_tokens(b: &mut test::Bencher) { - b.iter(|| scorrect::identifier::tokenize(data::NO_TOKENS.as_bytes()).collect::>()); + b.iter(|| defenestrate::identifier::tokenize(data::NO_TOKENS.as_bytes()).collect::>()); } #[bench] fn tokenize_single_token(b: &mut test::Bencher) { - b.iter(|| scorrect::identifier::tokenize(data::SINGLE_TOKEN.as_bytes()).collect::>()); + b.iter(|| defenestrate::identifier::tokenize(data::SINGLE_TOKEN.as_bytes()).collect::>()); } #[bench] fn tokenize_sherlock(b: &mut test::Bencher) { - b.iter(|| scorrect::identifier::tokenize(data::SHERLOCK.as_bytes()).collect::>()); + b.iter(|| defenestrate::identifier::tokenize(data::SHERLOCK.as_bytes()).collect::>()); } #[bench] fn tokenize_code(b: &mut test::Bencher) { - b.iter(|| scorrect::identifier::tokenize(data::CODE.as_bytes()).collect::>()); + b.iter(|| defenestrate::identifier::tokenize(data::CODE.as_bytes()).collect::>()); } #[bench] fn tokenize_corpus(b: &mut test::Bencher) { - b.iter(|| scorrect::identifier::tokenize(data::CORPUS.as_bytes()).collect::>()); + b.iter(|| defenestrate::identifier::tokenize(data::CORPUS.as_bytes()).collect::>()); } diff --git a/src/main.rs b/src/main.rs index edd4485..1a69753 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,12 +15,12 @@ arg_enum!{ } impl Format { - fn report(self) -> scorrect::report::Report { + fn report(self) -> defenestrate::report::Report { match self { - Format::Silent => scorrect::report::print_silent, - Format::Brief => scorrect::report::print_brief, - Format::Long => scorrect::report::print_long, - Format::Json => scorrect::report::print_json, + Format::Silent => defenestrate::report::print_silent, + Format::Brief => defenestrate::report::print_brief, + Format::Long => defenestrate::report::print_long, + Format::Json => defenestrate::report::print_json, } } } @@ -63,7 +63,7 @@ impl Options { fn run() -> Result<(), failure::Error> { let options = Options::from_args().infer(); - let dictionary = scorrect::Dictionary::new(); + let dictionary = defenestrate::Dictionary::new(); let first_path = &options.path.get(0).expect("arg parsing enforces at least one"); let mut walk = ignore::WalkBuilder::new(first_path); @@ -75,7 +75,7 @@ fn run() -> Result<(), failure::Error> { for entry in walk.build() { let entry = entry?; if entry.file_type().map(|t| t.is_file()).unwrap_or(true) { - scorrect::process_file(entry.path(), &dictionary, options.format.report())?; + defenestrate::process_file(entry.path(), &dictionary, options.format.report())?; } }