Skip to content

Commit

Permalink
chore: add "typos" tool and run it in codebase/docs (#1063)
Browse files Browse the repository at this point in the history
* ci: Add typos package

* docs: Fix typos in docs

* docs: Run typos over CHANGELOG to fix

* typos in tests_functional/

* Exclude vendors/ from typos check

* doc: Fix typos in dynaconf docstrings/comments

* Fix typos in tests/

* ci: Add typos as pre-commit hook

* fix: pre-commit failures

Add .github/ to exclude since I couldn't get it to check here locally by
default but it did seem to be on the pre-commit hook

---------

Co-authored-by: Pedro Brochado <[email protected]>
  • Loading branch information
mitches-got-glitches and pedro-psb committed Mar 3, 2024
1 parent b4251ac commit 4ab5183
Show file tree
Hide file tree
Showing 21 changed files with 70 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
workflow_dispatch:

# When a Push is made on an existing branch/PR
# it cancells any pre running job and
# it cancels any pre running job and
# let only the latest executing
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
with:
python-version: "3.8"

- name: "Prepare build environemnt"
- name: "Prepare build environment"
run: |
pip install --user python-minifier wheel setuptools
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@ repos:
hooks:
- id: mypy
files: ^dynaconf/
- repo: https://github.com/crate-ci/typos
rev: v1.18.2
hooks:
- id: typos
args: [] # Overrides default to write changes.
64 changes: 32 additions & 32 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ Other

* remove breakpoint

* Pinning ipython version for python 3.8 compatability.
* Pinning ipython version for python 3.8 compatibility.

---------
- Fix AttributeError with integer keys (yaml) #919 (#920) [Pedro Pessoa]
Expand Down Expand Up @@ -364,7 +364,7 @@ Other
* add test for #905 (item duplication in list)

- when using validator with the default field, list items would get
duplicated under certain circunstances.
duplicated under certain circumstances.

* fix for #905

Expand Down Expand Up @@ -529,7 +529,7 @@ Other

* add path-filter to main ci. fix rfc #883

* fix identation (3 to 2 spaces)
* fix indentation (3 to 2 spaces)
- Docs/add faq page (#882) [Pedro Pessoa]

* add faq page to docs
Expand Down Expand Up @@ -1608,7 +1608,7 @@ Other
- Fix #478 Make alias for environment -> environments (#534) [Bruno
Rocha]

This is a commom mistake to pass `environment` so it is alias.
This is a common mistake to pass `environment` so it is alias.

Fix #478
- Fix #462 make DynaBox nested List to use DynaBox as default class
Expand Down Expand Up @@ -1768,7 +1768,7 @@ Other

* Change map to list comprehension and create empty [] as default value

* fix wrong identation
* fix wrong indentation
- Fix merging hyperlink to fix #454 (#458) [Ilito Torquato, Ilito
Torquato]
- Specify flask extension initializers by entry point object reference
Expand Down Expand Up @@ -1871,7 +1871,7 @@ Other
- Fix #432 no need for warning when env is missing on a file (#438)
[Bruno Rocha]

When env is missing on a file ther eis no need to output
When env is missing on a file there is no need to output
a warning.

All envs are optional on files.
Expand Down Expand Up @@ -2149,7 +2149,7 @@ Other
Fix #379 dict like iteration (#385)
Fix #377 allow computed values (#386)
Fix #388 URL reference for custom loaders (#389)
Fix #382 add is_overriden method (#390)
Fix #382 add is_overridden method (#390)

John Vandenberg (1):
Allow testing against local redis server (#387)
Expand Down Expand Up @@ -2177,7 +2177,7 @@ Other
Fix #379 dict like iteration (#385)
Fix #377 allow computed values (#386)
Fix #388 URL reference for custom loaders (#389)
Fix #382 add is_overriden method (#390)
Fix #382 add is_overridden method (#390)

John Vandenberg (1):
Allow testing against local redis server (#387)
Expand All @@ -2187,9 +2187,9 @@ Other
- Allow importing SEARCHTREE before settings are configured (#383)
[Andreas Poehlmann]
- Allow testing against local redis server (#387) [John Vandenberg]
- Fix #382 add is_overriden method (#390) [Bruno Rocha]
- Fix #382 add is_overridden method (#390) [Bruno Rocha]

Fix #382 add is_overriden method for DJDT
Fix #382 add is_overridden method for DJDT
- Fix #388 URL reference for custom loaders (#389) [Bruno Rocha]

Fix #388 URL reference for custom loaders
Expand All @@ -2208,7 +2208,7 @@ Other
Fix #327
Fix #341

Exemples added:
Examples added:

example/issues/323_DEFAULT_VALUES_RESOLUTION/
example/issues/325_flask_dot_env/
Expand Down Expand Up @@ -2562,7 +2562,7 @@ Other
The release of python-box https://github.com/cdgriffith/Box/pull/116
is a breaking change.

So pinning this until this project addapts.
So pinning this until this project adapts.

Also pinning other direct deps.
- Fix #258 custom message for validators. [Bruno Rocha]
Expand Down Expand Up @@ -2953,7 +2953,7 @@ Other
Use the Key Value API rather than the old 'read' and 'write' methods (#198)
- Fix #194 flask.app.config __setitem__ (#199) [Bruno Rocha]

Flask.config was not proxying __setitem__ atribute so this
Flask.config was not proxying __setitem__ attribute so this
change adds a call to __setitem__ on contrib/flask_dynaconf
- Use the Key Value API rather than the old 'read' and 'write' methods
(#198) [Raoul Snyman]
Expand Down Expand Up @@ -3067,7 +3067,7 @@ Other
HOTFIX config.md on docs [skip ci] (#171)
Fix some open file descriptors on exampls and tests (#172)
Fix #151 setup pre-commit and black (#173)
Add CONTRIBUTING.md, conrtib isntructions and Black badge (#174)
Add CONTRIBUTING.md, contrib instructions and Black badge (#174)
Fix release script

David Moreau Simard (1):
Expand Down Expand Up @@ -3100,7 +3100,7 @@ Other
HOTFIX config.md on docs [skip ci] (#171)
Fix some open file descriptors on exampls and tests (#172)
Fix #151 setup pre-commit and black (#173)
Add CONTRIBUTING.md, conrtib isntructions and Black badge (#174)
Add CONTRIBUTING.md, contrib instructions and Black badge (#174)
Fix release script

David Moreau Simard (1):
Expand All @@ -3110,7 +3110,7 @@ Other
Skip reloading envs for validators that only apply to current_env (#162)
Fix #163 Allow disabling env prefix (#164)
- Fix release script. [Bruno Rocha]
- Add CONTRIBUTING.md, conrtib isntructions and Black badge (#174)
- Add CONTRIBUTING.md, contrib instructions and Black badge (#174)
[Bruno Rocha]
- Fix #151 setup pre-commit and black (#173) [Bruno Rocha]

Expand Down Expand Up @@ -3178,7 +3178,7 @@ Other

removed logzero, cached logger using lru_cache (that means that if loglevel changes, log changes)

- imporved docs and badges.
- improved docs and badges.
- Fix typos in bash export examples. [David Moreau Simard]
- HOTIX: Django doc. [Bruno Rocha]
- Added Django explicit mode to docs (#149) [Bruno Rocha]
Expand Down Expand Up @@ -3209,7 +3209,7 @@ Other
Fix #110 add docs for dynaconf_include
Add dynaconf_include examples
Set up CI with Azure Pipelines (#142)
Add dynaconf_merge fucntionality for dict and list settings. (#139)
Add dynaconf_merge functionality for dict and list settings. (#139)
Preparing for 2.0.0

Byungjin Park (1):
Expand Down Expand Up @@ -3271,7 +3271,7 @@ Other
Fix #110 add docs for dynaconf_include
Add dynaconf_include examples
Set up CI with Azure Pipelines (#142)
Add dynaconf_merge fucntionality for dict and list settings. (#139)
Add dynaconf_merge functionality for dict and list settings. (#139)
Preparing for 2.0.0

Byungjin Park (1):
Expand Down Expand Up @@ -3330,10 +3330,10 @@ Other
- start_dotenv is now Lazy (only when settings._setup is called)
- Added new _FOR_DYNACONF config options ENV_SWITCHER, SKIP_FILES, INCLUDES & SECRETS
- Renamed config PROJECT_ROOT -> ROOT_PATH
- Add dynaconf_merge fucntionality for dict and list settings. (#139)
- Add dynaconf_merge functionality for dict and list settings. (#139)
[Bruno Rocha]

If your settings has existing variables of types `list` ot `dict` and you want to `merge` instead of `override` then
If your settings has existing variables of types `list` or `dict` and you want to `merge` instead of `override` then
the `dynaconf_merge` and `dynaconf_merge_unique` stanzas can mark that variable as a candidate for merging.

For **dict** value:
Expand Down Expand Up @@ -3370,7 +3370,7 @@ Other
dynaconf_merge: true
```

The `dynaconf_merge` token will mark that object to be merged with existing values (of course `dynaconf_merge` key will not be added to the final settings it is jsut a mark)
The `dynaconf_merge` token will mark that object to be merged with existing values (of course `dynaconf_merge` key will not be added to the final settings it is just a mark)

The end result will be on `[development]` env:

Expand Down Expand Up @@ -3653,7 +3653,7 @@ Other
- Python 3.4 has different error message. [Mantas]
- Remove mocker fixture. [Mantas]

Left this accidentaly.
Left this accidentally.

https://travis-ci.org/rochacbruno/dynaconf/jobs/452612532
- Add INSTANCE_FOR_DYNACONF and --instance. [Mantas]
Expand Down Expand Up @@ -3855,8 +3855,8 @@ Other
- Add example for merge_configs. [Bruno Rocha]
- Add setting merging. [Raoul Snyman]

- Addd the ability to merge nested structures instead of completely overwriting them
- Use monkeypatch to stop one test from interferring with another
- Add the ability to merge nested structures instead of completely overwriting them
- Use monkeypatch to stop one test from interfering with another
- Updated documentation


Expand Down Expand Up @@ -3906,7 +3906,7 @@ Other
[latty]
- Release 1.0.3. [Bruno Rocha]

- Excluded example and tests from realease dist
- Excluded example and tests from release dist
- removed root logger configuration


Expand Down Expand Up @@ -4003,7 +4003,7 @@ Other
- Increase cli test coverage. [Bruno Rocha]
- Dynaconf variables in blue and user variables in green. [Bruno Rocha]
- Added `dynaconf list` and `dynaconf write` subcommands. [Bruno Rocha]
- More cli commands lsit and write. [Bruno Rocha]
- More cli commands list and write. [Bruno Rocha]
- Added more tests for cli and py loader. [Bruno Rocha]
- Replaced coveralls with codecov #57. [Bruno Rocha]
- Modularized the loaders, added `dynaconf init` command. [Bruno Rocha]
Expand All @@ -4019,9 +4019,9 @@ Other
- Merge pull request #52 from rochacbruno/fix_namespace_in_django.
[Bruno Rocha]

Fix namespace swithc in django apps
Fix namespace switch in django apps
- Add missing .env. [Bruno Rocha]
- Fix namespace swithc in django apps. [Bruno Rocha]
- Fix namespace switch in django apps. [Bruno Rocha]


0.7.5 (2018-05-20)
Expand Down Expand Up @@ -4209,7 +4209,7 @@ Other
- Add Pipfile.lock to .gitignore. [Douglas Soares de Andrade]
- Small Refactory. [Douglas Soares de Andrade]

- Adding object to the Settings classe to make it work with Python2
- Adding object to the Settings class to make it work with Python2
- Small Refactory. [Douglas Soares de Andrade]

- Reordering the imports according to pylint and flake8
Expand Down Expand Up @@ -4278,7 +4278,7 @@ Other
- Added note about get_fresh in readme. [Bruno Rocha]
- Better namespace management, get_fresh(key) to access redis. [Bruno
Rocha]
- Now it can be used programatically. [Bruno Rocha]
- Now it can be used programmatically. [Bruno Rocha]


0.2.1 (2015-12-20)
Expand All @@ -4289,7 +4289,7 @@ Other

0.2.0 (2015-12-20)
------------------
- Can also load from arbitraty filepath. [Bruno Rocha]
- Can also load from arbitrary filepath. [Bruno Rocha]
- Renamed var, added loaders, bump version. [Bruno Rocha]


Expand Down
8 changes: 8 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[files]
extend-exclude = ["*.svg", "pt-br", "dynaconf/vendor/*", ".github/*"]

[default.extend-words]
Fo = "Fo"
portugues = "portugues"
hashi = "hashi"
ba = "ba"
4 changes: 2 additions & 2 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Usage: dynaconf inspect [OPTIONS]

Inspect the loading history of the given settings instance.

Filters by key and environement, otherwise shows all.
Filters by key and environment, otherwise shows all.

Options:
-k, --key TEXT Filters result by key.
Expand Down Expand Up @@ -176,7 +176,7 @@ Usage: dynaconf get [OPTIONS] KEY

Returns the raw value for a settings key.

If result is a dict, list or tuple it is printes as a valid json string.
If result is a dict, list or tuple it is printed as a valid json string.

Options:
-d, --default TEXT Default value if settings doesn't exist
Expand Down
2 changes: 1 addition & 1 deletion docs/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ Validator(
must_exist=True, # redundant but allowed
startswith="user_",
cast=str,
condition=lambda v: v not in FORBIDEN_USERS,
condition=lambda v: v not in FORBIDDEN_USERS,
...
)
```
Expand Down
2 changes: 1 addition & 1 deletion dynaconf/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ def set(
:param key: The key to store. Can be of any type.
:param value: The raw value to parse and store
:param loader_identifier: Optional loader name e.g: toml, yaml etc.
Or isntance of SourceMetadata
Or instance of SourceMetadata
:param tomlfy: Bool define if value is parsed by toml (defaults False)
:param merge: Bool define if existing nested data will be merged.
:param validate: Bool define if validation will be triggered
Expand Down
4 changes: 2 additions & 2 deletions dynaconf/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ def init(ctx, fileformat, path, env, _vars, _secrets, wg, y, django):
def get(key, default, env, unparse):
"""Returns the raw value for a settings key.
If result is a dict, list or tuple it is printes as a valid json string.
If result is a dict, list or tuple it is printed as a valid json string.
"""
if env:
env = env.strip()
Expand Down Expand Up @@ -860,7 +860,7 @@ def inspect(
"""
Inspect the loading history of the given settings instance.
Filters by key and environement, otherwise shows all.
Filters by key and environment, otherwise shows all.
"""
try:
inspect_settings(
Expand Down
2 changes: 1 addition & 1 deletion dynaconf/loaders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def default_loader(obj, defaults=None):
"""Initial loader for the initialization process.
Steps:
- Load default settings (from static module) + kwargs overrides (togheter)
- Load default settings (from static module) + kwargs overrides (together)
- Load envvar overrides
"""
# LOAD DEFAULT STATIC + KWARGS OVERRIDES
Expand Down
2 changes: 1 addition & 1 deletion dynaconf/loaders/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def _set_data_to_obj(

class SourceMetadata(NamedTuple):
"""
Usefull metadata about some loaded source (file, envvar, etc).
Useful metadata about some loaded source (file, envvar, etc).
Serve as a unique identifier for data from a specific env
and a specific source (file, envvar, validationd default, etc)
Expand Down
2 changes: 1 addition & 1 deletion dynaconf/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def trimmed_split(
continue
data = [item.strip() for item in s.strip().split(sep)]
return data
return [s] # raw un-splitted
return [s] # raw un-split


T = TypeVar("T")
Expand Down
2 changes: 1 addition & 1 deletion dynaconf/utils/parse_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ def boolean_fix(value: str | None):
"""Gets a value like `True/False` and turns to `true/false`
This function exists because of issue #976
Toml parser casts booleans from true/false lower case
however envvars are usually exportes as True/False capitalized
however envvars are usually exported as True/False capitalized
by mistake, this helper fixes it for envvars only.
Assume envvars are always str.
Expand Down
1 change: 1 addition & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ flake8-todo
radon
pre-commit
mypy
typos

# tools
ipython<=8.12.1
Expand Down

0 comments on commit 4ab5183

Please sign in to comment.