Skip to content

Commit

Permalink
spell check (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
ameily authored Apr 23, 2023
1 parent 7b0f991 commit 9b3d454
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 10 deletions.
21 changes: 19 additions & 2 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.1",
"version": "0.2",
"words": [
"meily",
"cincoconfig",
Expand Down Expand Up @@ -36,6 +36,22 @@
"noqa",
"rpartition",
"pyright",
"strerror",
"ciphertext",
"startdir",
"netbios",
"hostname",
"hostnames",
"modname",
"typestr",
"subkey",
"prefixlen",
"subval",
"reparsed",
"autocompleter",
"getframe",
"subconfig",
"subconfigs",

// spinx docs
"autofunction",
Expand All @@ -46,7 +62,8 @@
"modindex",
"toctree",
"autodata",
"maxdepth"
"maxdepth",
"linenos"
],
"dictionaries": [
"en_US",
Expand Down
6 changes: 3 additions & 3 deletions cincoconfig/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def __getval__(self, cfg: "Config") -> Any:
def __setdefault__(self, cfg: "Config") -> None:
"""
Set the default value in the configuration. Subclasses should set the field's default value
using the :meth:`Config._set_deafult_value` method. For example:
using the :meth:`Config._set_default_value` method. For example:
.. code-block:: python
Expand Down Expand Up @@ -339,7 +339,7 @@ def validate(self, cfg, value):
- The top-level schema is configured to autogenerate and load environment variables for all
fields.
- ``mode`` is loaded from the ``APP_MODE`` environment variable.
- ``port`` is not loaded from any the environment variabale.
- ``port`` is not loaded from any the environment variable.
- ``db.host`` is loaded from the ``DB_HOST`` environment variable.
- The ``auth`` schema has a environment variable prefix of ``SECRET``. All children and nested
fields/schemas will start with ``SECRET_``.
Expand Down Expand Up @@ -1261,7 +1261,7 @@ def to_tree(
- ``None`` (default) - include the value as-is in the tree
- ``len(sensitive_mask) == 1`` (single character) - replace every character with the
``sensitive_mask`` character. ``value = sensitive_mask * len(value)``
- ``len(sensitive_mask) != 1`` (empty or multicharacter string) - replace the entire value
- ``len(sensitive_mask) != 1`` (empty or multi character string) - replace the entire value
with the ``sensitive_mask``.
:param virtual: include virtual field values in the tree
Expand Down
2 changes: 2 additions & 0 deletions cincoconfig/encryption.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"""
Encryption classes and methods.
"""

# spell-checker:ignore padder bindata
import os
from itertools import cycle
from typing import NamedTuple, Optional, Tuple, Union
Expand Down
4 changes: 2 additions & 2 deletions cincoconfig/fields/dict_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ def __eq__(self, other: Any) -> bool:
class DictField(Field):
"""
A generic :class:`dict` field that optionally validates keys and values. The ``key_field`` and
``value_field`` paramters control whether and how the dictionary keys and values are validated,
respectively. Setting these will cause the internal representation to be stored in a
``value_field`` parameters control whether and how the dictionary keys and values are
validated, respectively. Setting these will cause the internal representation to be stored in a
:class:`DictProxy` which handles the validation operations.
Specifying *required=True* will cause the field validation to validate that the ``dict`` is
Expand Down
2 changes: 1 addition & 1 deletion cincoconfig/fields/file_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(
- ``"file"`` - validate that the filename is a file that exists
The *startdir* parameter, if specified, will resolve filenames starting from a directory
and will cause all filenames to be validate to their abslute file path. If not specified,
and will cause all filenames to be validate to their absolute file path. If not specified,
filename's will be resolve relative to :meth:`os.getcwd` and the relative file path will
be validated.
Expand Down
2 changes: 1 addition & 1 deletion cincoconfig/fields/secure_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class ChallengeField(Field):
- ``digest`` - base64 encoded digest
The challenge field supports loading plaintext string values from the configuration file. So,
when manually writting the config file, the user does not need to create the salt and digest
when manually writing the config file, the user does not need to create the salt and digest
pair but, instead, just specify a plaintext string to hash. The value will be properly saved
as a salt/digest pair the next time the config file is saved to disk.
Expand Down
2 changes: 1 addition & 1 deletion cincoconfig/fields/string_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def _validate(self, cfg: Config, value: str) -> str:
raise ValueError("value must be at least %d characters" % self.min_len)

if self.max_len is not None and len(value) > self.max_len:
raise ValueError("value must not be more than %d chatacters" % self.max_len)
raise ValueError("value must not be more than %d characters" % self.max_len)

if self.regex and not self.regex.match(value):
raise ValueError("value does not match pattern %s" % self.regex.pattern)
Expand Down

0 comments on commit 9b3d454

Please sign in to comment.