mirror of
https://github.com/crate-ci/typos.git
synced 2024-12-22 07:32:18 -05:00
fix: Settle on a name?
This commit is contained in:
parent
85ee5cfac9
commit
af196a9561
8 changed files with 67 additions and 67 deletions
|
@ -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<X>.<Y>.<Z>`
|
||||
- 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
|
||||
|
|
42
Cargo.lock
generated
42
Cargo.lock
generated
|
@ -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"
|
||||
|
|
10
Cargo.toml
10
Cargo.toml
|
@ -1,10 +1,10 @@
|
|||
[package]
|
||||
name = "scorrect"
|
||||
name = "defenestrate"
|
||||
version = "0.1.0"
|
||||
authors = ["Ed Page <eopage@gmail.com>"]
|
||||
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"
|
||||
|
|
16
README.md
16
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
|
||||
|
|
|
@ -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"));
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -6,30 +6,30 @@ mod data;
|
|||
|
||||
#[bench]
|
||||
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]
|
||||
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]
|
||||
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]
|
||||
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]
|
||||
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]
|
||||
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<_>>());
|
||||
}
|
||||
|
|
14
src/main.rs
14
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())?;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue