fix: Settle on a name?

This commit is contained in:
Ed Page 2019-04-16 17:27:55 -06:00
parent 85ee5cfac9
commit af196a9561
8 changed files with 67 additions and 67 deletions

View file

@ -1,4 +1,4 @@
# Contributing to scorrect # Contributing to defenestrate
Thanks for wanting to contribute! There are many ways to contribute and we Thanks for wanting to contribute! There are many ways to contribute and we
appreciate any level you're willing to do. 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<X>.<Y>.<Z>` - `git push upstream master --tag v<X>.<Y>.<Z>`
- Run `cargo publish` (run `cargo login` first if needed) - Run `cargo publish` (run `cargo login` first if needed)
[issues]: https://github.com/crate-ci/scorrect/issues [issues]: https://github.com/crate-ci/defenestrate/issues
[new issue]: https://github.com/crate-ci/scorrect/issues/new [new issue]: https://github.com/crate-ci/defenestrate/issues/new
[all issues]: https://github.com/crate-ci/scorrect/issues?utf8=%E2%9C%93&q=is%3Aissue [all issues]: https://github.com/crate-ci/defenestrate/issues?utf8=%E2%9C%93&q=is%3Aissue
[travis]: https://github.com/crate-ci/scorrect/blob/master/.travis.yml [travis]: https://github.com/crate-ci/defenestrate/blob/master/.travis.yml

42
Cargo.lock generated
View file

@ -141,6 +141,27 @@ dependencies = [
"memchr 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "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]] [[package]]
name = "difference" name = "difference"
version = "2.0.0" version = "2.0.0"
@ -612,27 +633,6 @@ name = "scopeguard"
version = "0.3.3" version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index" 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]] [[package]]
name = "semver" name = "semver"
version = "0.9.0" version = "0.9.0"

View file

@ -1,10 +1,10 @@
[package] [package]
name = "scorrect" name = "defenestrate"
version = "0.1.0" version = "0.1.0"
authors = ["Ed Page <eopage@gmail.com>"] authors = ["Ed Page <eopage@gmail.com>"]
description = "Source Code Spelling Correction" description = "Source Code Spelling Correction"
repository = "https://github.com/crate-ci/scorrect" repository = "https://github.com/crate-ci/defenestrate"
documentation = "https://docs.rs/scorrect" documentation = "https://docs.rs/defenestrate"
readme = "README.md" readme = "README.md"
categories = ["development-tools", "text-processing"] categories = ["development-tools", "text-processing"]
keywords = ["development", "spelling"] keywords = ["development", "spelling"]
@ -12,8 +12,8 @@ license = "MIT"
edition = "2018" edition = "2018"
[badges] [badges]
travis-ci = { repository = "crate-ci/scorrect" } travis-ci = { repository = "crate-ci/defenestrate" }
appveyor = { repository = "epage/scorrect" } appveyor = { repository = "epage/defenestrate" }
[dependencies] [dependencies]
failure = "0.1" failure = "0.1"

View file

@ -1,12 +1,12 @@
# scorrect # defenestrate
> **Source Code Spelling Correction** > **Source Code Spelling Correction**
[![Travis Status](https://travis-ci.org/crate-ci/scorrect.svg?branch=master)](https://travis-ci.org/crate-ci/scorrect) [![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/scorrect/branch/master) [![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] [![Documentation](https://img.shields.io/badge/docs-master-blue.svg)][Documentation]
![License](https://img.shields.io/crates/l/scorrect.svg) ![License](https://img.shields.io/crates/l/defenestrate.svg)
[![Crates Status](https://img.shields.io/crates/v/scorrect.svg)](https://crates.io/crates/scorrect) [![Crates Status](https://img.shields.io/crates/v/defenestrate.svg)](https://crates.io/crates/defenestrate)
## Install ## Install
@ -14,7 +14,7 @@ Add to your `Cargo.toml`:
```toml ```toml
[dependencies] [dependencies]
scorrect = "0.3" defenestrate = "0.3"
``` ```
## License ## 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 license, shall be dual licensed as above, without any additional terms or
conditions. conditions.
[Crates.io]: https://crates.io/crates/scorrect [Crates.io]: https://crates.io/crates/defenestrate
[Documentation]: https://docs.rs/scorrect [Documentation]: https://docs.rs/defenestrate

View file

@ -4,19 +4,19 @@ extern crate test;
#[bench] #[bench]
fn load_corrections(b: &mut test::Bencher) { fn load_corrections(b: &mut test::Bencher) {
b.iter(|| scorrect::Dictionary::new()); b.iter(|| defenestrate::Dictionary::new());
} }
#[bench] #[bench]
fn correction(b: &mut test::Bencher) { fn correction(b: &mut test::Bencher) {
let corrections = scorrect::Dictionary::new(); let corrections = defenestrate::Dictionary::new();
assert_eq!(corrections.correct_str("successs"), Some("successes")); assert_eq!(corrections.correct_str("successs"), Some("successes"));
b.iter(|| corrections.correct_str("successs")); b.iter(|| corrections.correct_str("successs"));
} }
#[bench] #[bench]
fn no_correction(b: &mut test::Bencher) { fn no_correction(b: &mut test::Bencher) {
let corrections = scorrect::Dictionary::new(); let corrections = defenestrate::Dictionary::new();
assert_eq!(corrections.correct_str("success"), None); assert_eq!(corrections.correct_str("success"), None);
b.iter(|| corrections.correct_str("success")); b.iter(|| corrections.correct_str("success"));
} }

View file

@ -12,8 +12,8 @@ fn process_empty(b: &mut test::Bencher) {
let sample_path = temp.child("sample"); let sample_path = temp.child("sample");
sample_path.write_str(data::EMPTY).unwrap(); sample_path.write_str(data::EMPTY).unwrap();
let corrections = scorrect::Dictionary::new(); let corrections = defenestrate::Dictionary::new();
b.iter(|| scorrect::process_file(sample_path.path(), &corrections, scorrect::report::print_silent)); b.iter(|| defenestrate::process_file(sample_path.path(), &corrections, defenestrate::report::print_silent));
temp.close().unwrap(); temp.close().unwrap();
} }
@ -24,8 +24,8 @@ fn process_no_tokens(b: &mut test::Bencher) {
let sample_path = temp.child("sample"); let sample_path = temp.child("sample");
sample_path.write_str(data::NO_TOKENS).unwrap(); sample_path.write_str(data::NO_TOKENS).unwrap();
let corrections = scorrect::Dictionary::new(); let corrections = defenestrate::Dictionary::new();
b.iter(|| scorrect::process_file(sample_path.path(), &corrections, scorrect::report::print_silent)); b.iter(|| defenestrate::process_file(sample_path.path(), &corrections, defenestrate::report::print_silent));
temp.close().unwrap(); temp.close().unwrap();
} }
@ -36,8 +36,8 @@ fn process_single_token(b: &mut test::Bencher) {
let sample_path = temp.child("sample"); let sample_path = temp.child("sample");
sample_path.write_str(data::SINGLE_TOKEN).unwrap(); sample_path.write_str(data::SINGLE_TOKEN).unwrap();
let corrections = scorrect::Dictionary::new(); let corrections = defenestrate::Dictionary::new();
b.iter(|| scorrect::process_file(sample_path.path(), &corrections, scorrect::report::print_silent)); b.iter(|| defenestrate::process_file(sample_path.path(), &corrections, defenestrate::report::print_silent));
temp.close().unwrap(); temp.close().unwrap();
} }
@ -48,8 +48,8 @@ fn process_sherlock(b: &mut test::Bencher) {
let sample_path = temp.child("sample"); let sample_path = temp.child("sample");
sample_path.write_str(data::SHERLOCK).unwrap(); sample_path.write_str(data::SHERLOCK).unwrap();
let corrections = scorrect::Dictionary::new(); let corrections = defenestrate::Dictionary::new();
b.iter(|| scorrect::process_file(sample_path.path(), &corrections, scorrect::report::print_silent)); b.iter(|| defenestrate::process_file(sample_path.path(), &corrections, defenestrate::report::print_silent));
temp.close().unwrap(); temp.close().unwrap();
} }
@ -60,8 +60,8 @@ fn process_code(b: &mut test::Bencher) {
let sample_path = temp.child("sample"); let sample_path = temp.child("sample");
sample_path.write_str(data::CODE).unwrap(); sample_path.write_str(data::CODE).unwrap();
let corrections = scorrect::Dictionary::new(); let corrections = defenestrate::Dictionary::new();
b.iter(|| scorrect::process_file(sample_path.path(), &corrections, scorrect::report::print_silent)); b.iter(|| defenestrate::process_file(sample_path.path(), &corrections, defenestrate::report::print_silent));
temp.close().unwrap(); temp.close().unwrap();
} }
@ -72,8 +72,8 @@ fn process_corpus(b: &mut test::Bencher) {
let sample_path = temp.child("sample"); let sample_path = temp.child("sample");
sample_path.write_str(data::CORPUS).unwrap(); sample_path.write_str(data::CORPUS).unwrap();
let corrections = scorrect::Dictionary::new(); let corrections = defenestrate::Dictionary::new();
b.iter(|| scorrect::process_file(sample_path.path(), &corrections, scorrect::report::print_silent)); b.iter(|| defenestrate::process_file(sample_path.path(), &corrections, defenestrate::report::print_silent));
temp.close().unwrap(); temp.close().unwrap();
} }

View file

@ -6,30 +6,30 @@ mod data;
#[bench] #[bench]
fn tokenize_empty(b: &mut test::Bencher) { fn tokenize_empty(b: &mut test::Bencher) {
b.iter(|| scorrect::identifier::tokenize(data::EMPTY.as_bytes()).collect::<Vec<_>>()); b.iter(|| defenestrate::identifier::tokenize(data::EMPTY.as_bytes()).collect::<Vec<_>>());
} }
#[bench] #[bench]
fn tokenize_no_tokens(b: &mut test::Bencher) { fn tokenize_no_tokens(b: &mut test::Bencher) {
b.iter(|| scorrect::identifier::tokenize(data::NO_TOKENS.as_bytes()).collect::<Vec<_>>()); b.iter(|| defenestrate::identifier::tokenize(data::NO_TOKENS.as_bytes()).collect::<Vec<_>>());
} }
#[bench] #[bench]
fn tokenize_single_token(b: &mut test::Bencher) { fn tokenize_single_token(b: &mut test::Bencher) {
b.iter(|| scorrect::identifier::tokenize(data::SINGLE_TOKEN.as_bytes()).collect::<Vec<_>>()); b.iter(|| defenestrate::identifier::tokenize(data::SINGLE_TOKEN.as_bytes()).collect::<Vec<_>>());
} }
#[bench] #[bench]
fn tokenize_sherlock(b: &mut test::Bencher) { fn tokenize_sherlock(b: &mut test::Bencher) {
b.iter(|| scorrect::identifier::tokenize(data::SHERLOCK.as_bytes()).collect::<Vec<_>>()); b.iter(|| defenestrate::identifier::tokenize(data::SHERLOCK.as_bytes()).collect::<Vec<_>>());
} }
#[bench] #[bench]
fn tokenize_code(b: &mut test::Bencher) { fn tokenize_code(b: &mut test::Bencher) {
b.iter(|| scorrect::identifier::tokenize(data::CODE.as_bytes()).collect::<Vec<_>>()); b.iter(|| defenestrate::identifier::tokenize(data::CODE.as_bytes()).collect::<Vec<_>>());
} }
#[bench] #[bench]
fn tokenize_corpus(b: &mut test::Bencher) { fn tokenize_corpus(b: &mut test::Bencher) {
b.iter(|| scorrect::identifier::tokenize(data::CORPUS.as_bytes()).collect::<Vec<_>>()); b.iter(|| defenestrate::identifier::tokenize(data::CORPUS.as_bytes()).collect::<Vec<_>>());
} }

View file

@ -15,12 +15,12 @@ arg_enum!{
} }
impl Format { impl Format {
fn report(self) -> scorrect::report::Report { fn report(self) -> defenestrate::report::Report {
match self { match self {
Format::Silent => scorrect::report::print_silent, Format::Silent => defenestrate::report::print_silent,
Format::Brief => scorrect::report::print_brief, Format::Brief => defenestrate::report::print_brief,
Format::Long => scorrect::report::print_long, Format::Long => defenestrate::report::print_long,
Format::Json => scorrect::report::print_json, Format::Json => defenestrate::report::print_json,
} }
} }
} }
@ -63,7 +63,7 @@ impl Options {
fn run() -> Result<(), failure::Error> { fn run() -> Result<(), failure::Error> {
let options = Options::from_args().infer(); 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 first_path = &options.path.get(0).expect("arg parsing enforces at least one");
let mut walk = ignore::WalkBuilder::new(first_path); let mut walk = ignore::WalkBuilder::new(first_path);
@ -75,7 +75,7 @@ fn run() -> Result<(), failure::Error> {
for entry in walk.build() { for entry in walk.build() {
let entry = entry?; let entry = entry?;
if entry.file_type().map(|t| t.is_file()).unwrap_or(true) { 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())?;
} }
} }