From 17e89220777f6f939d76c70314fd74b7395b90d8 Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Mon, 18 Nov 2024 13:38:04 -0500 Subject: [PATCH] Typos and typos ci (#646) --- .github/workflows/typos.yml | 17 +++++++++++++++++ CHANGELOG.md | 8 ++++---- UPDATING.md | 2 +- _typos.toml | 9 +++++++++ examples/syntax-highlighting/README.md | 2 +- minijinja-contrib/src/filters/mod.rs | 2 +- minijinja/src/compiler/parser.rs | 2 +- minijinja/src/filters.rs | 2 +- 8 files changed, 35 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/typos.yml create mode 100644 _typos.toml diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml new file mode 100644 index 00000000..1056ec10 --- /dev/null +++ b/.github/workflows/typos.yml @@ -0,0 +1,17 @@ +name: Typos Check +on: + pull_request: + workflow_dispatch: + +jobs: + run: + name: Spell Check with Typos + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v4 + + - name: Check spelling + uses: crate-ci/typos@master + with: + config: ./_typos.toml diff --git a/CHANGELOG.md b/CHANGELOG.md index 6546004b..3be20990 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,7 +48,7 @@ All notable changes to MiniJinja are documented here. ## 2.3.1 -- Fixes a regresion in `PartialEq` / `Eq` in `Value` caused by changes +- Fixes a regression in `PartialEq` / `Eq` in `Value` caused by changes in 2.3.0. #584 ## 2.3.0 @@ -133,9 +133,9 @@ All notable changes to MiniJinja are documented here. ## 2.0.0 This is a major update to MiniJinja that changes a lot of core internals and -cleans up some APIs. In particular it resolves somes limitations in the engine +cleans up some APIs. In particular it resolves some limitations in the engine in relation to working with dynamic objects, unlocks potentials for future -performance improvments and enhancements. +performance improvements and enhancements. It's very likely that you will need to do changes to your code when upgrading, particular when implementing dynamic objects. In short: @@ -247,7 +247,7 @@ For upgrade instructions read the [UPDATING](UPDATING.md) guide. includes or extends from paths not explicitly allowlisted. #432 - Added support for `Error::display_debug_info` which displays just the debug info, same way as alternative display on the error does. #420 -- Added the `namspace()` function from Jinja2 and the ability to assign +- Added the `namespace()` function from Jinja2 and the ability to assign to it via `{% set %}`. #422 - `minijinja-autoreload` now supports `on_should_reload_callback` which lets one register a callback to be called just before an auto reload diff --git a/UPDATING.md b/UPDATING.md index 5011247d..4b426cc4 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -206,7 +206,7 @@ let value = Value::from_seq_object(SimpleDynamicSeq(...)); Because the default object representation is a `Map`, we need to change it to `ObjectRepr::seq` in the `repr` method. As sequences iterate over their values, we can use the convenient `Enumerator::Seq` -enumerator which instructs the engine to sequentually iterate over +enumerator which instructs the engine to sequentially iterate over the object from `0` to the given `length`. Otherwise the interface is the same as with the map above, which means that rather than implementing `get_item` you now also implement `get_value` which diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 00000000..59be6edc --- /dev/null +++ b/_typos.toml @@ -0,0 +1,9 @@ +[default] +extend-ignore-identifiers-re = ["workd", "entit", "FoO", "mis", "flate"] + +[default.extend-words] +# these are false positives in data/examples +ridiculus = "ridiculus" +facilisi = "facilisi" +Facilisi = "Facilisi" +nam = "nam" diff --git a/examples/syntax-highlighting/README.md b/examples/syntax-highlighting/README.md index 8464e327..cac2642e 100644 --- a/examples/syntax-highlighting/README.md +++ b/examples/syntax-highlighting/README.md @@ -1,6 +1,6 @@ # syntax-highlighting -An example that shows how to register a function for syntax highlighting wiht syntect. +An example that shows how to register a function for syntax highlighting with syntect. ```console $ cargo run diff --git a/minijinja-contrib/src/filters/mod.rs b/minijinja-contrib/src/filters/mod.rs index a2647aaa..560b7784 100644 --- a/minijinja-contrib/src/filters/mod.rs +++ b/minijinja-contrib/src/filters/mod.rs @@ -59,7 +59,7 @@ pub fn pluralize(v: Value, singular: Option, plural: Option) -> Re } } -/// Choses a random element from a sequence or string. +/// Chooses a random element from a sequence or string. /// /// The random number generated can be seeded with the `RAND_SEED` /// global context variable. diff --git a/minijinja/src/compiler/parser.rs b/minijinja/src/compiler/parser.rs index 9228e688..cbdac0a9 100644 --- a/minijinja/src/compiler/parser.rs +++ b/minijinja/src/compiler/parser.rs @@ -614,7 +614,7 @@ impl<'a> Parser<'a> { // in parts because the opcodes can only express 2**16 as argument // count. if args.len() > 2000 { - syntax_error!("Too many aguments in function call") + syntax_error!("Too many arguments in function call") } } diff --git a/minijinja/src/filters.rs b/minijinja/src/filters.rs index 535c0f42..69c8ad69 100644 --- a/minijinja/src/filters.rs +++ b/minijinja/src/filters.rs @@ -1085,7 +1085,7 @@ mod builtins { /// ```jinja /// example: /// config: - /// {{ global_conifg|indent(2) }} # does not indent first line + /// {{ global_config|indent(2) }} # does not indent first line /// {{ global_config|indent(2,true) }} # indent whole Value with two spaces /// {{ global_config|indent(2,true,true)}} # indent whole Value and all blank lines /// ```