Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
Found via `codespell -L crate,nnumber,hel,dne`
  • Loading branch information
kianmeng committed Sep 11, 2022
1 parent 6d5d7de commit 932a3a7
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
* `fetch`: Reformatted report so response is the last column; do not allow --timeout to be zero; progressbar refresh set at 5 times/sec; show name of generated report at the end. https://github.com/jqnatividad/qsv/pull/404
* `fetch`: report improvements. Remove `qsv_fetch_` column prefix in short report; change progressbar format to default characters https://github.com/jqnatividad/qsv/pull/406
* `excel`: make --sheet case-insensitve; better error-handling https://github.com/jqnatividad/qsv/pull/416
* `excel`: make --sheet case-insensitive; better error-handling https://github.com/jqnatividad/qsv/pull/416
* `py`: add detected python version to --version option
* Only do input utf8-encoding check for commands that need it. https://github.com/jqnatividad/qsv/pull/419
* Bump cached from 0.37.0 to 0.38.0 by @dependabot in https://github.com/jqnatividad/qsv/pull/407
Expand Down Expand Up @@ -247,7 +247,7 @@ but aborting after 100 errors. Also added a separate error progress bar. https:/
## [0.58.1] - 2022-07-02
### Changed
* Universal clippy handling. Added allow clippy hint section in main for clippy lints we allow/ignore, and added exceptions as needed throughout the codebase.
This means clippy, even in pedantic/nursery/perf mode willl have no warnings. https://github.com/jqnatividad/qsv/pull/365
This means clippy, even in pedantic/nursery/perf mode will have no warnings. https://github.com/jqnatividad/qsv/pull/365
* reqwest deflate compression support https://github.com/jqnatividad/qsv/pull/366
* `fetch`: expanded --http-header explanation/example
* `fetch`: refactored --timeout processing https://github.com/jqnatividad/qsv/commit/3454ed068f0f243473a0f66520f90f55ece4bf49
Expand Down Expand Up @@ -771,7 +771,7 @@ use the patches. This should also result in smaller binaries.
* `fetch`: argument parsing refactor, removing need for dummy argument in https://github.com/jqnatividad/qsv/pull/222
* applied select pedantic clippy recommendations in https://github.com/jqnatividad/qsv/pull/224
* simplified multithreading - removed jobs div by three heuristic in https://github.com/jqnatividad/qsv/pull/225
* use qsv-dateparser fork of dateparser for incresed performance of `stats`, `schema` and `apply` in https://github.com/jqnatividad/qsv/pull/230
* use qsv-dateparser fork of dateparser for increased performance of `stats`, `schema` and `apply` in https://github.com/jqnatividad/qsv/pull/230
* Bump actions/checkout from 2.3.3 to 3 by @dependabot in https://github.com/jqnatividad/qsv/pull/228
* Bump actions/stale from 3 to 5 by @dependabot in https://github.com/jqnatividad/qsv/pull/227
* Bump actions/setup-python from 2 to 3.1.0 by @dependabot in https://github.com/jqnatividad/qsv/pull/226
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ echo "complete -F _docopt_wordlist_commands qsv" >> $HOME/.bash_completion

## File formats

qsv recognizes UTF-8/ASCII encoded, CSV (`.csv`) and TSV files (`.tsv` and `.tab`). CSV files are assummed to have "," (comma) as a delimiter,
qsv recognizes UTF-8/ASCII encoded, CSV (`.csv`) and TSV files (`.tsv` and `.tab`). CSV files are assumed to have "," (comma) as a delimiter,
and TSV files, "\t" (tab) as a delimiter. The delimiter is a single ascii character that can be set either by the `--delimiter` command-line option or
with the `QSV_DEFAULT_DELIMITER` environment variable or automatically detected when `QSV_SNIFF_DELIMITER` is set.

Expand Down Expand Up @@ -273,7 +273,7 @@ The following "power-user" features can be abused and present "foot-shooting" sc

* `lua` - enable `lua` command. Embeds a [Lua 5.4.4](https://www.lua.org/manual/5.4/manual.html) interpreter into qsv.
* `foreach` - enable `foreach` command (not valid for Windows).
* `python` - enable `py` command (requires Python 3.8+ development libraris). Note that qsv will automatically use the currently activated python version when running in a virtual environment unless there's a python library (libpython.* on Linux/macOS, python*.dll on Windows) in the directory where qsv is located.
* `python` - enable `py` command (requires Python 3.8+ development libraries). Note that qsv will automatically use the currently activated python version when running in a virtual environment unless there's a python library (libpython.* on Linux/macOS, python*.dll on Windows) in the directory where qsv is located.

> ℹ️ **NOTE:** `qsvlite`, as the name implies, always has **non-default features disabled**. `qsv` can be built with any combination of the above features using the cargo `--features` & `--no-default-features` flags. The pre-built `qsv` binaries has **all applicable features valid for the target platform**[^6].
Expand Down
2 changes: 1 addition & 1 deletion docs/Logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ To keep things simple:

## Enable Logging

Set enviroment variable `QSV_LOG_LEVEL` to desired level. Default is `off`.
Set environment variable `QSV_LOG_LEVEL` to desired level. Default is `off`.
* off - no logging
* error
* warn
Expand Down
2 changes: 1 addition & 1 deletion docs/PERFORMANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ The `apply geocode` command [memoizes](https://en.wikipedia.org/wiki/Memoization
The `fetch` and `fetchpost` commands also memoizes expensive REST API calls with its optional Redis support. It effectively has a persistent cache as the default time-to-live (TTL) before a Redis cache entry is expired is 28 days and Redis entries are persisted across restarts. Redis cache settings can be fine-tuned with the `QSV_REDIS_CONNSTR`, `QSV_REDIS_TTL_SECONDS`, `QSV_REDIS_TTL_REFRESH` and `QSV_FP_REDIS_CONNSTR` environment variables.

## UTF-8 Encoding for Performance
[Rust strings are utf-8 encoded](https://doc.rust-lang.org/std/string/struct.String.html). As a result, qsv **requires** UTF-8 encoded files, primarily, for performance. It makes extensive use of [`str::from_utf8_unchecked`](https://doc.rust-lang.org/stable/std/str/fn.from_utf8_unchecked.html) to skip utf-8 validation that [`str::from_utf8`](https://doc.rust-lang.org/stable/std/str/fn.from_utf8.html) will otherwise incur everytime raw bytes are converted to string, even if the file is already utf8-encoded.
[Rust strings are utf-8 encoded](https://doc.rust-lang.org/std/string/struct.String.html). As a result, qsv **requires** UTF-8 encoded files, primarily, for performance. It makes extensive use of [`str::from_utf8_unchecked`](https://doc.rust-lang.org/stable/std/str/fn.from_utf8_unchecked.html) to skip utf-8 validation that [`str::from_utf8`](https://doc.rust-lang.org/stable/std/str/fn.from_utf8.html) will otherwise incur every time raw bytes are converted to string, even if the file is already utf8-encoded.

For the most part, this shouldn't be a problem as UTF-8 is the de facto encoding standard. Should you need to process a CSV file with a different encoding, use the `input` command first to "[loosely transcode](https://doc.rust-lang.org/std/string/struct.String.html#method.from_utf8_lossy)" it to UTF-8.

Expand Down
2 changes: 1 addition & 1 deletion resources/test/boston311-100.csv
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ case_enquiry_id,open_dt,target_dt,closed_dt,ontime,case_status,closure_reason,ca
101004114783,2022-01-03 12:19:00,2022-01-04 12:19:43,2022-01-03 14:05:26,ONTIME,Closed,Case Closed. Closed date : 2022-01-03 14:05:26.86 Case Resolved Area ticketed ,Parking Enforcement,Transportation - Traffic Division,Enforcement & Abandoned Vehicles,Parking Enforcement,BTDT_Parking Enforcement,BTDT,,,32 Mount Vernon St Dorchester MA 02125,6,03,2,C6,Dorchester,5,Ward 7,0709,32 Mount Vernon St,02125,42.322,-71.0573,Constituent Call
101004114795,2022-01-03 12:29:00,2022-03-07 12:29:41,,OVERDUE,Open, ,Graffiti: Ward 8 0803 ,Property Management,Graffiti,Graffiti Removal,PROP_GRAF_GraffitiRemoval,PROP,,,2000A Washington St Roxbury MA 02118,7,10B,7,D4,Roxbury,13,Ward 8,0803,2000A Washington St,02118,42.3333,-71.0797,Constituent Call
101004114807,2022-01-03 12:35:00,,2022-01-10 16:30:33,ONTIME,Closed,Case Closed. Closed date : 2022-01-10 16:30:33.11 Bulk Item Automation ,Schedule a Bulk Item Pickup,Public Works Department,Sanitation,Schedule a Bulk Item Pickup,PWDx_Schedule a Bulk Item Pickup,PWDx,,,21 Ellington St Dorchester MA 02121,7,03,4,B3,Greater Mattapan,13,Ward 14,1403,21 Ellington St,02121,42.3021,-71.0844,Constituent Call
101004114815,2022-01-03 12:39:00,2022-01-24 12:39:57,2022-01-18 07:54:26,ONTIME,Closed,Case Closed Case Resolved NO OVERFLOW NO ADDITONAL CART DELV 1/11/22 ,Request for Recycling Cart,Public Works Department,Recycling,Request for Recycling Cart,PWDx_Recycling Sent to Contractor,PWDx,,,98 Draper St Dorchester MA 02122,7,03,3,C11,Dorchester,8,Ward 15,1507,98 Draper St,02122,42.3048,-71.0653,Constituent Call
101004114815,2022-01-03 12:39:00,2022-01-24 12:39:57,2022-01-18 07:54:26,ONTIME,Closed,Case Closed Case Resolved NO OVERFLOW NO ADDITIONAL CART DELV 1/11/22 ,Request for Recycling Cart,Public Works Department,Recycling,Request for Recycling Cart,PWDx_Recycling Sent to Contractor,PWDx,,,98 Draper St Dorchester MA 02122,7,03,3,C11,Dorchester,8,Ward 15,1507,98 Draper St,02122,42.3048,-71.0653,Constituent Call
101004114820,2022-01-03 12:47:00,2022-02-17 12:47:39,2022-04-25 14:30:31,OVERDUE,Closed,Case Closed. Closed date : 2022-04-25 14:30:31.163 Case Resolved REPLACED POLE AND FIXTURE CLEARED CONDUIT AND PULLED NEW # 10 LATERAL FROM FIXTURE TO PULL BOX TIED IN AS NEEDED ALSO BACK FILLED SUB BASE TO GRADE ISSUED PATCH W/O G. Mc CARTHY / S.RIED / J. HENNESSY / N.MUSTACCHIO ,Printed: left on Nicky's desk,Public Works Department,Street Lights,General Lighting Request,PWDx_Street Light_General Lighting Request,PWDx,,,80 Fulda St Roxbury MA 02119,9,10B,7,B2,Roxbury,13,Ward 11,1102,80 Fulda St,02119,42.3227,-71.0948,City Worker App
101004114838,2022-01-03 13:07:00,2022-01-05 13:07:19,2022-01-03 13:32:02,ONTIME,Closed,Case Closed. Closed date : Mon Jan 03 13:32:02 EST 2022 Resolved Ticket was issued for improper storage of trash ,Improper Storage of Trash (Barrels),Public Works Department,Code Enforcement,Improper Storage of Trash (Barrels),PWDx_Code Enforcement,PWDx,,,326 Dorchester St South Boston MA 02127,6,05,2,C6,South Boston / South Boston Waterfront,5,Ward 7,0706,326 Dorchester St,02127,42.331,-71.0537,Constituent Call
101004115093,2022-01-03 16:06:33,,2022-01-04 08:15:58,ONTIME,Closed,Case Closed. Closed date : 2022-01-04 08:15:58.1 Case Invalid This case has been closed as there is not enough information to process this request. If you feel this has been closed in error please dial 311 to submit a new request. Sincerely Boston 311 Team ,City/State Snow Issues,Mayor's 24 Hour Hotline,Programs,City/State Snow Issues,INFO01_GenericeFormforOtherServiceRequestTypes,INFO,,,40 Battery St Boston MA 02109,3,1B,1,A1,Boston,3,03,0301,40 Battery St,02109,42.3594,-71.0587,Constituent Call
Expand Down
2 changes: 1 addition & 1 deletion resources/test/boston311-dmy-100.csv
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ case_enquiry_id,open_dt,target_dt,closed_dt,ontime,case_status,closure_reason,ca
101004114783,03/01/2022 12:19:00,04/01/2022 12:19:43,03/01/2022 14:05:26,ONTIME,Closed,Case Closed. Closed date : 2022-01-03 14:05:26.86 Case Resolved Area ticketed ,Parking Enforcement,Transportation - Traffic Division,Enforcement & Abandoned Vehicles,Parking Enforcement,BTDT_Parking Enforcement,BTDT,,,32 Mount Vernon St Dorchester MA 02125,6,03,2,C6,Dorchester,5,Ward 7,0709,32 Mount Vernon St,02125,42.322,-71.0573,Constituent Call
101004114795,03/01/2022 12:29:00,07/03/2022 12:29:41,,OVERDUE,Open, ,Graffiti: Ward 8 0803 ,Property Management,Graffiti,Graffiti Removal,PROP_GRAF_GraffitiRemoval,PROP,,,2000A Washington St Roxbury MA 02118,7,10B,7,D4,Roxbury,13,Ward 8,0803,2000A Washington St,02118,42.3333,-71.0797,Constituent Call
101004114807,03/01/2022 12:35:00,,10/01/2022 16:30:33,ONTIME,Closed,Case Closed. Closed date : 2022-01-10 16:30:33.11 Bulk Item Automation ,Schedule a Bulk Item Pickup,Public Works Department,Sanitation,Schedule a Bulk Item Pickup,PWDx_Schedule a Bulk Item Pickup,PWDx,,,21 Ellington St Dorchester MA 02121,7,03,4,B3,Greater Mattapan,13,Ward 14,1403,21 Ellington St,02121,42.3021,-71.0844,Constituent Call
101004114815,03/01/2022 12:39:00,24/01/2022 12:39:57,18/01/2022 07:54:26,ONTIME,Closed,Case Closed Case Resolved NO OVERFLOW NO ADDITONAL CART DELV 1/11/22 ,Request for Recycling Cart,Public Works Department,Recycling,Request for Recycling Cart,PWDx_Recycling Sent to Contractor,PWDx,,,98 Draper St Dorchester MA 02122,7,03,3,C11,Dorchester,8,Ward 15,1507,98 Draper St,02122,42.3048,-71.0653,Constituent Call
101004114815,03/01/2022 12:39:00,24/01/2022 12:39:57,18/01/2022 07:54:26,ONTIME,Closed,Case Closed Case Resolved NO OVERFLOW NO ADDITIONAL CART DELV 1/11/22 ,Request for Recycling Cart,Public Works Department,Recycling,Request for Recycling Cart,PWDx_Recycling Sent to Contractor,PWDx,,,98 Draper St Dorchester MA 02122,7,03,3,C11,Dorchester,8,Ward 15,1507,98 Draper St,02122,42.3048,-71.0653,Constituent Call
101004114820,03/01/2022 12:47:00,17/02/2022 12:47:39,25/04/2022 14:30:31,OVERDUE,Closed,Case Closed. Closed date : 2022-04-25 14:30:31.163 Case Resolved REPLACED POLE AND FIXTURE CLEARED CONDUIT AND PULLED NEW # 10 LATERAL FROM FIXTURE TO PULL BOX TIED IN AS NEEDED ALSO BACK FILLED SUB BASE TO GRADE ISSUED PATCH W/O G. Mc CARTHY / S.RIED / J. HENNESSY / N.MUSTACCHIO ,Printed: left on Nicky's desk,Public Works Department,Street Lights,General Lighting Request,PWDx_Street Light_General Lighting Request,PWDx,,,80 Fulda St Roxbury MA 02119,9,10B,7,B2,Roxbury,13,Ward 11,1102,80 Fulda St,02119,42.3227,-71.0948,City Worker App
101004114838,03/01/2022 13:07:00,05/01/2022 13:07:19,03/01/2022 13:32:02,ONTIME,Closed,Case Closed. Closed date : Mon Jan 03 13:32:02 EST 2022 Resolved Ticket was issued for improper storage of trash ,Improper Storage of Trash (Barrels),Public Works Department,Code Enforcement,Improper Storage of Trash (Barrels),PWDx_Code Enforcement,PWDx,,,326 Dorchester St South Boston MA 02127,6,05,2,C6,South Boston / South Boston Waterfront,5,Ward 7,0706,326 Dorchester St,02127,42.331,-71.0537,Constituent Call
101004115093,03/01/2022 16:06:33,,04/01/2022 08:15:58,ONTIME,Closed,Case Closed. Closed date : 2022-01-04 08:15:58.1 Case Invalid This case has been closed as there is not enough information to process this request. If you feel this has been closed in error please dial 311 to submit a new request. Sincerely Boston 311 Team ,City/State Snow Issues,Mayor's 24 Hour Hotline,Programs,City/State Snow Issues,INFO01_GenericeFormforOtherServiceRequestTypes,INFO,,,40 Battery St Boston MA 02109,3,1B,1,A1,Boston,3,03,0301,40 Battery St,02109,42.3594,-71.0587,Constituent Call
Expand Down
4 changes: 2 additions & 2 deletions resources/test/public-toilets-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
},
"Notes":
{
"description": "Notes on reporting, accesibility, hours or anything else",
"description": "Notes on reporting, accessibility, hours or anything else",
"type": ["string", "null"]
},
"UPRN":
Expand All @@ -160,7 +160,7 @@
},
"GeoAreaURI":
{
"description": "A predefined spatial area that the application is contained in. Note that these can be derived from X/Y co-ordinates. Comma delimit in spreadsheet where there is more than one",
"description": "A predefined spatial area that the application is contained in. Note that these can be derived from X/Y coordinates. Comma delimit in spreadsheet where there is more than one",
"type": ["string", "null"]
},
"GeoAreaLabel":
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/enumerate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ enum options:
--copy <column> Name of a column to copy.
Changes the default column name to "{column}_copy".
--uuid When set, the column will be populated with
uuids (v4) instead of the incremental identifer.
uuids (v4) instead of the incremental identifier.
Changes the default column name to "uuid".
Common options:
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
let vals: Vec<&str> = header.split(':').collect();

if vals.len() != 2 {
return fail_format!("{vals:?} is not a valid key-value pair. Expecting a key and a value seperated by a colon.");
return fail_format!("{vals:?} is not a valid key-value pair. Expecting a key and a value separated by a colon.");
}

// allocate new String for header key to put into map
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/fetchpost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
let vals: Vec<&str> = header.split(':').collect();

if vals.len() != 2 {
return fail_format!("{vals:?} is not a valid key-value pair. Expecting a key and a value seperated by a colon.");
return fail_format!("{vals:?} is not a valid key-value pair. Expecting a key and a value separated by a colon.");
}

// allocate new String for header key to put into map
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ pub fn infer_schema_from_stats(args: &Args, input_filename: &str) -> CliResult<M
}

if col_null_count > 0 && enum_list.len() > 0 {
// for fields that are not mandatory and actualy have enum list generated,
// for fields that are not mandatory and actually have enum list generated,
// having JSON NULL indicates that missing value is allowed
enum_list.push(Value::Null);
}
Expand Down Expand Up @@ -445,7 +445,7 @@ fn build_low_cardinality_column_selector_arg(
}

/// get frequency tables from `cmd::stats`
/// returns map of unique valules keyed by header
/// returns map of unique values keyed by header
fn get_unique_values(
args: &Args,
column_select_arg: &str,
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Usage:
split options:
-s, --size <arg> The number of records to write into each chunk.
[default: 500]
-j, --jobs <arg> The number of spliting jobs to run in parallel.
-j, --jobs <arg> The number of splitting jobs to run in parallel.
This only works when the given CSV data has
an index already created. Note that a file handle
is opened for each job.
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ fn validate_json_instance(
})
.collect(),
BasicOutput::Valid(_annotations) => {
// shouln't happen
// shouldn't happen
unreachable!("Unexpected error.");
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ pub fn range(start: Idx, end: Idx, len: Idx, index: Idx) -> Result<(usize, usize
}
}

/// Create a directory recursively, avoiding the race conditons fixed by
/// Create a directory recursively, avoiding the race conditions fixed by
/// https://github.com/rust-lang/rust/pull/39799.
#[cfg(any(feature = "full", feature = "lite"))]
fn create_dir_all_threadsafe(path: &Path) -> io::Result<()> {
Expand Down

0 comments on commit 932a3a7

Please sign in to comment.