未验证 提交 6116f48f 编写于 作者: C Christian Clauss 提交者: GitHub

Fix typos discovered by codespell (#1207)

* Fix typos discovered by codespell

* Add codespell to pre-commit
上级 a6ac9cef
......@@ -6,6 +6,11 @@ repos:
hooks:
- id: black
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
- id: codespell # See setup.cfg for args
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
......
......@@ -64,7 +64,7 @@ Release v2.0.0a1 (2022-06-29)
- Retrieve the candidate metadata by parsing the `pyproject.toml` rather than building it. [#1156](https://github.com/pdm-project/pdm/issues/1156)
- Update the format converters to support the new `[tool.pdm.build]` table. [#1157](https://github.com/pdm-project/pdm/issues/1157)
- Scripts are now available as root command if they don't conflict with any builtin or plugin-contributed command. [#1159](https://github.com/pdm-project/pdm/issues/1159)
- Add a `post_use` hook triggered after succesfully switching Python version. [#1163](https://github.com/pdm-project/pdm/issues/1163)
- Add a `post_use` hook triggered after successfully switching Python version. [#1163](https://github.com/pdm-project/pdm/issues/1163)
- Add project configuration `respect-source-order` under `[tool.pdm.resolution]` to respect the source order in the `pyproject.toml` file. Packages will be returned by source earlier in the order or later ones if not found. [#593](https://github.com/pdm-project/pdm/issues/593)
### Bug Fixes
......
......@@ -6,9 +6,9 @@ of a Python project lifecycle and PDM provides commands to perform the expected
It also provides hooks attached to these steps allowing for:
- plugins to listen to the [signals][pdm.signals] of the same name.
- developpers to define custom scripts with the same name.
- developers to define custom scripts with the same name.
The built-in commands are currently splitted in 3 groups:
The built-in commands are currently split into 3 groups:
- the [initialization phase](#initialization)
- the [dependencies management](#dependencies-managment).
......@@ -21,7 +21,7 @@ To provides full flexibility, PDM allows to [skip some hooks and tasks](#skippin
## Initialization
The intialization phase should occur only once in a project lifetime by running the [`pdm init`](cli_reference.md#exec-0--init)
The initialization phase should occur only once in a project lifetime by running the [`pdm init`](cli_reference.md#exec-0--init)
command to initialize an existing project (prompt to fill the `pyproject.toml` file).
They trigger the following hooks:
......@@ -46,7 +46,7 @@ The dependencies management is required for the developer to be able to work and
- `add`: add a dependency
- `remove`: remove a dependency
All thoses steps are directly available with the following commands:
All those steps are directly available with the following commands:
- [`pdm lock`](cli_reference.md#exec-0--lock): execute the `lock` task
- [`pdm sync`](cli_reference.md#exec-0--sync): execute the `sync` task
......@@ -102,12 +102,12 @@ flowchart LR
## Publication
As soon as you are ready to publish you package/app/libray, you will require the publication tasks:
As soon as you are ready to publish your package/app/library, you will require the publication tasks:
- `build`: build/compile assets requiring it and package everything into a Python package (sdist, wheel)
- `upload`: upload/publish the package to a remote PyPI index
All thoses steps are available with the following commands:
All those steps are available with the following commands:
- [`pdm build`](cli_reference.md#exec-0--build)
- [`pdm publish`](cli_reference.md#exec-0--publish)
......
......@@ -28,7 +28,7 @@ Although PDM run on Python 3.7 and above, you can still have lower Python versio
| `flit-core>=3.4` | `>=3.6` | Yes |
| `flit-core>=3.2,<3.4` | `>=3.4` | Yes |
Note that if your project is an application(without `name` metadata), the above limitation of backends don't apply, since you don't need a build backend afterall, and you can use a Python version up to `2.7`.
Note that if your project is an application(without `name` metadata), the above limitation of backends don't apply, since you don't need a build backend after all, and you can use a Python version up to `2.7`.
## Build distribution artifacts
......
......@@ -63,7 +63,7 @@ class Command(BaseCommand):
project.python = PythonInfo.from_path(get_venv_python(path))
except Exception as e: # pragma: no cover
project.core.ui.echo(
f"Error occured when creating virtualenv: {e}\n"
f"Error occurred when creating virtualenv: {e}\n"
"Please fix it and create later.",
style="red",
err=True,
......
......@@ -232,9 +232,9 @@ class TaskRunner:
)
if kind == "composite":
for script in value:
splitted = shlex.split(script)
cmd = splitted[0]
subargs = splitted[1:] + args # type: ignore
split = shlex.split(script)
cmd = split[0]
subargs = split[1:] + args # type: ignore
code = self.run(cmd, subargs, options)
if code != 0:
return code
......
......@@ -23,7 +23,7 @@ class PurgeCommand(BaseCommand):
"-i",
"--interactive",
action="store_true",
help="Interatively purge selected Virtualenvs",
help="Interactively purge selected Virtualenvs",
)
def handle(self, project: Project, options: argparse.Namespace) -> None:
......
......@@ -35,7 +35,7 @@ class HookManager:
def should_run(self, name: str) -> bool:
"""
Tells wether a task given its name should run or not
Tells whether a task given its name should run or not
according to the current skipping rules.
"""
return (
......
......@@ -113,11 +113,11 @@ def split_lists(separator: str) -> type[argparse.Action]:
) -> None:
if not isinstance(values, str):
return
splitted = getattr(args, self.dest) or []
splitted.extend(
split = getattr(args, self.dest) or []
split.extend(
value.strip() for value in values.split(separator) if value.strip()
)
setattr(args, self.dest, splitted)
setattr(args, self.dest, split)
return SplitList
......
......@@ -373,7 +373,7 @@ class Synchronizer:
+ traceback.format_exception(*exc_info)
)
# get rich progess and live handler to deal with multiple spinners
# get rich progress and live handler to deal with multiple spinners
with self.ui.logging("install"), self.ui.make_progress(
" ",
SpinnerColumn(termui.SPINNER, speed=1, style="bold cyan"),
......
......@@ -120,5 +120,5 @@ post_use: NamedSignal = pdm_signals.signal("post_use")
Args:
project (Project): The project object
python (PythonInfo): Informations about the new Python interpreter
python (PythonInfo): Information about the new Python interpreter
"""
......@@ -85,7 +85,7 @@ bold = partial(style, style="bold", deprecated=True)
def ask(
*args: str, prompt_type: Type[str] | Type[int] | None = None, **kwargs: Any
) -> str:
"""prompt user and return reponse
"""prompt user and return response
:prompt_type: which rich prompt to use, defaults to str.
:raises ValueError: unsupported prompt type
......
......@@ -15,6 +15,9 @@ ignore =
W503
W601
[codespell]
ignore-words-list = ba,overriden,te
[coverage:run]
branch = true
source = pdm/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册