From 932a3a7a2254738beaa355505baa635aea4f5627 Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Sun, 11 Sep 2022 21:03:25 +0800 Subject: [PATCH] fix typos Found via `codespell -L crate,nnumber,hel,dne` --- CHANGELOG.md | 6 +++--- README.md | 4 ++-- docs/Logging.md | 2 +- docs/PERFORMANCE.md | 2 +- resources/test/boston311-100.csv | 2 +- resources/test/boston311-dmy-100.csv | 2 +- resources/test/public-toilets-schema.json | 4 ++-- src/cmd/enumerate.rs | 2 +- src/cmd/fetch.rs | 2 +- src/cmd/fetchpost.rs | 2 +- src/cmd/schema.rs | 4 ++-- src/cmd/split.rs | 2 +- src/cmd/validate.rs | 2 +- src/util.rs | 2 +- 14 files changed, 19 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a853661de..dd26ae90e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 @@ -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 @@ -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 diff --git a/README.md b/README.md index 06e7c29de..04e5c536d 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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]. diff --git a/docs/Logging.md b/docs/Logging.md index e6e4e3476..0686fc969 100644 --- a/docs/Logging.md +++ b/docs/Logging.md @@ -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 diff --git a/docs/PERFORMANCE.md b/docs/PERFORMANCE.md index 4f5f9f3da..9c0875d34 100644 --- a/docs/PERFORMANCE.md +++ b/docs/PERFORMANCE.md @@ -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. diff --git a/resources/test/boston311-100.csv b/resources/test/boston311-100.csv index e2770d8a9..ce2e8afc0 100644 --- a/resources/test/boston311-100.csv +++ b/resources/test/boston311-100.csv @@ -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 diff --git a/resources/test/boston311-dmy-100.csv b/resources/test/boston311-dmy-100.csv index 7e7cdd617..fb5d11fa1 100644 --- a/resources/test/boston311-dmy-100.csv +++ b/resources/test/boston311-dmy-100.csv @@ -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 diff --git a/resources/test/public-toilets-schema.json b/resources/test/public-toilets-schema.json index 8b93bebf9..5be085b3c 100644 --- a/resources/test/public-toilets-schema.json +++ b/resources/test/public-toilets-schema.json @@ -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": @@ -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": diff --git a/src/cmd/enumerate.rs b/src/cmd/enumerate.rs index c6c6643b8..3389d0846 100644 --- a/src/cmd/enumerate.rs +++ b/src/cmd/enumerate.rs @@ -34,7 +34,7 @@ enum options: --copy 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: diff --git a/src/cmd/fetch.rs b/src/cmd/fetch.rs index f62eedeb0..eb3b4a3c8 100644 --- a/src/cmd/fetch.rs +++ b/src/cmd/fetch.rs @@ -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 diff --git a/src/cmd/fetchpost.rs b/src/cmd/fetchpost.rs index 6e7024a95..298ab0ab8 100644 --- a/src/cmd/fetchpost.rs +++ b/src/cmd/fetchpost.rs @@ -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 diff --git a/src/cmd/schema.rs b/src/cmd/schema.rs index db2dcade7..79fb37b6e 100644 --- a/src/cmd/schema.rs +++ b/src/cmd/schema.rs @@ -332,7 +332,7 @@ pub fn infer_schema_from_stats(args: &Args, input_filename: &str) -> CliResult 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); } @@ -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, diff --git a/src/cmd/split.rs b/src/cmd/split.rs index 155c8ba57..0bbb62d41 100644 --- a/src/cmd/split.rs +++ b/src/cmd/split.rs @@ -11,7 +11,7 @@ Usage: split options: -s, --size The number of records to write into each chunk. [default: 500] - -j, --jobs The number of spliting jobs to run in parallel. + -j, --jobs 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. diff --git a/src/cmd/validate.rs b/src/cmd/validate.rs index 0eff51c34..33fde283c 100644 --- a/src/cmd/validate.rs +++ b/src/cmd/validate.rs @@ -731,7 +731,7 @@ fn validate_json_instance( }) .collect(), BasicOutput::Valid(_annotations) => { - // shouln't happen + // shouldn't happen unreachable!("Unexpected error."); } }; diff --git a/src/util.rs b/src/util.rs index 2129ebc19..8f0e7a210 100644 --- a/src/util.rs +++ b/src/util.rs @@ -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<()> {