Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

precommit: enable codespell #35

Merged
merged 3 commits into from
Oct 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ repos:
args: ["--py37-plus"]
name: Upgrade code

- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
hooks:
- id: codespell
additional_dependencies: [tomli]
#args: ["--write-changes"] # uncomment if you want to get automatic fixing

#- repo: https://github.com/PyCQA/docformatter
# rev: v1.5.1
# hooks:
Expand Down
11 changes: 10 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,21 @@ exclude_lines = [
"pragma: no cover",
"pass",
]

[tool.coverage.run]
parallel = true
relative_files = true


[tool.codespell]
#skip = '*.py'
quiet-level = 3
# comma separated list of words; waiting for:
# https://github.com/codespell-project/codespell/issues/2839#issuecomment-1731601603
# also adding links until they ignored by its: nature
# https://github.com/codespell-project/codespell/issues/2243#issuecomment-1732019960
#ignore-words-list = ""


[tool.black]
# https://github.com/psf/black
line-length = 120
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def _load_py_module(fname: str, pkg: str = "deprecate"):

def _load_long_description(path_dir: str, version: str) -> str:
path_readme = os.path.join(path_dir, "README.md")
with open(path_readme, encoding="utf-8") as fo:
text = fo.read()
with open(path_readme, encoding="utf-8") as fopen:
text = fopen.read()
# codecov badge
text = text.replace("/branch/main/graph/badge.svg", f"/release/{version}/graph/badge.svg")
# replace github badges for release ones
Expand Down
6 changes: 3 additions & 3 deletions src/deprecate/deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@

from deprecate.utils import get_func_arguments_types_defaults

#: Default template warning message fot redirecting callable
#: Default template warning message for redirecting callable
TEMPLATE_WARNING_CALLABLE = (
"The `%(source_name)s` was deprecated since v%(deprecated_in)s in favor of `%(target_path)s`."
" It will be removed in v%(remove_in)s."
)
#: Default template warning message for chnaging argument mapping
#: Default template warning message for changing argument mapping
TEMPLATE_WARNING_ARGUMENTS = (
"The `%(source_name)s` uses deprecated arguments: %(argument_map)s."
" They were deprecated since v%(deprecated_in)s and will be removed in v%(remove_in)s."
)
#: Tempalte for mapping from old to new examples
#: Template for mapping from old to new examples
TEMPLATE_ARGUMENT_MAPPING = "`%(old_arg)s` -> `%(new_arg)s`"
#: Default template warning message for no target func/method
TEMPLATE_WARNING_NO_TARGET = (
Expand Down
2 changes: 1 addition & 1 deletion src/deprecate/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def get_func_arguments_types_defaults(func: Callable) -> List[Tuple[str, Tuple,
func: a function to be xeamined

Returns:
sequence of details for each position/keyward argument
sequence of details for each position/keyword argument

Example:
>>> get_func_arguments_types_defaults(get_func_arguments_types_defaults)
Expand Down
Loading