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

Add codespell and fix typos #270

Merged
merged 1 commit into from
Feb 7, 2025
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
8 changes: 7 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ repos:
rev: v0.23
hooks:
- id: validate-pyproject
additional_dependencies: ['validate-pyproject-schema-store[all]']
additional_dependencies: ["validate-pyproject-schema-store[all]"]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.5.0
hooks:
Expand Down Expand Up @@ -51,3 +51,9 @@ repos:
types_or: [python, pyi]
always_run: true
require_serial: true
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
additional_dependencies:
- tomli
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Supported arguments:

### `usethis browse pypi <package>`

Dispaly or open the PyPI landing page associated with another project.
Display or open the PyPI landing page associated with another project.

Example:

Expand All @@ -167,7 +167,7 @@ Supported arguments:
## Development

This project is at the early stages of development. If you are interested in contributing,
please ensure you have a corresponsing GitHub Issue open.
please ensure you have a corresponding GitHub Issue open.

## License

Expand Down
16 changes: 8 additions & 8 deletions doc/pipeweld.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ There are four cases:
All components in case 1 can be left as-is.

All components in case 2 can be moved to a new parallel subgraph placed in series
before the exising one, or do-nothing if all the components are in case 2.
before the existing one, or do-nothing if all the components are in case 2.

All components in case 3 can be moved to a new parallel subgraph placed in series
after the existing one, or do nothing if all the components are in case 3.
Expand Down Expand Up @@ -167,14 +167,14 @@ would choose to satisfy dependencies in this case and will backtrack to resolve
the condition that the configuration group is mandatory (basically, it will ignore this
constraint).

If it is merely optional for a step to be in the same configuraiton group as another set
If it is merely optional for a step to be in the same configuration group as another set
of steps, then this is basically a cosmetic decision which can determined after the
new step has been inserted; should it form a configuration group with its predecessor,
or successor, or both? Pipeweld will choose to form with both if possible, and with any
existing group in precedence to creating a new group (including combining the
predecessor and successor steps' groups into a single group, if they the two groups are
of the same type). Any further tiebreaks will be broken by preferring to form a group
with the predecessor rather than the sucessor.
with the predecessor rather than the successor.

There is also the possibility that the new step is inserted into the middle of an
configuration group but is not compatible with that group's type. In that case,
Expand Down Expand Up @@ -213,7 +213,7 @@ since we never need to access step metadata. For now, string names of the steps
be sufficient.
5. Should a solution be the modified pipeline representation or the instructions on how
to modify the pipeline? We could also return both. Instructions on how to modify are
likely to be more useful. There are four operations needed to represet modification
likely to be more useful. There are four operations needed to represent modification
when adding a step; "insert as successor" and "insert after in parallel",
"insert after in series", and "split group". To remove a step requires two more;
"remove" (a unary operation), and "combine groups". A list of these operations would
Expand Down Expand Up @@ -335,7 +335,7 @@ traceback = [
]
```

### Example 6 (Mixed depency parallelism of steps)
### Example 6 (Mixed dependency parallelism of steps)

```Python
step = "C"
Expand Down Expand Up @@ -369,7 +369,7 @@ traceback = [
]
```

### Example 7 (Multi-level heirarchy)
### Example 7 (Multi-level hierarchy)

```Python
step = "E"
Expand All @@ -390,7 +390,7 @@ traceback = [
]
```

### Example 8 (Mixed depedency parallelism of series)
### Example 8 (Mixed dependency parallelism of series)

```Python
step = "E"
Expand Down Expand Up @@ -566,7 +566,7 @@ instructions = [
# post-requisite (so we don't want to insert parallel),
# and B is in an incompatible configuration group.
# (so we don't want to insert successor).
AddToGroup("B", "y"), # The sucessor to B is in a compatible configuration group
AddToGroup("B", "y"), # The successor to B is in a compatible configuration group
# and B only has one successor (C) so we can form a group.
# We need to check this when inserting series.
]
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ lint.ignore = [ "D417", "PLR2004", "SIM108" ]
lint.per-file-ignores."tests/**/*.py" = [ "D", "INP", "S101" ]
lint.pydocstyle.convention = "google"

[tool.codespell]
ignore-words-list = [ "edn" ]

[tool.pyproject-fmt]
keep_full_version = true

Expand Down
4 changes: 2 additions & 2 deletions src/usethis/_integrations/pre_commit/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def add_repo(repo: LocalRepo | UriRepo) -> None:

doc.model.repos.append(repo)
else:
# Get the precendents, i.e. hooks occuring before the new hook
# Get the precendents, i.e. hooks occurring before the new hook
try:
hook_idx = _HOOK_ORDER.index(hook_name)
except ValueError:
Expand Down Expand Up @@ -193,7 +193,7 @@ def extract_hook_names(model: JsonSchemaForPreCommitConfigYaml) -> list[str]:
for hook in repo.hooks:
hook_names.append(hook.id)

# Need to validate there are no duplciates
# Need to validate there are no duplicates
for name, count in Counter(hook_names).items():
if count > 1:
msg = f"Hook name '{name}' is duplicated"
Expand Down
4 changes: 2 additions & 2 deletions tests/usethis/_integrations/yaml/test_io_.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def test_time_stamp(self, tmp_path: Path):

class TestRoundTrip:
@pytest.mark.skip(
"Not providing this guarentee yet. ruamel.yaml isn't easily able to cope with perfect round-tripping"
"Not providing this guarantee yet. ruamel.yaml isn't easily able to cope with perfect round-tripping"
)
def test_single_quote_preserved(self, tmp_path: Path):
path = tmp_path / "x.yml"
Expand All @@ -297,7 +297,7 @@ def test_single_quote_preserved(self, tmp_path: Path):
)

@pytest.mark.skip(
"Not providing this guarentee yet. ruamel.yaml isn't easily able to cope with perfect round-tripping"
"Not providing this guarantee yet. ruamel.yaml isn't easily able to cope with perfect round-tripping"
)
def test_single_quoted_preserved(self, tmp_path: Path):
path = tmp_path / "x.yml"
Expand Down