Skip to content

Add a spellchecker #328

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ repos:
- id: ruff
args: ["--fix"]
- id: ruff-format
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
additional_dependencies:
- tomli
2 changes: 1 addition & 1 deletion docs/customize-pins-metadata.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Create consistent metadata for pins
jupyter: python3
---

The `metadata` argument in pins is flexible and can hold any kind of metadata that you can formulate as a `dict` (convertable to JSON).
The `metadata` argument in pins is flexible and can hold any kind of metadata that you can formulate as a `dict` (convertible to JSON).
In some situations, you may want to read and write with _consistent_ customized metadata;
you can create functions to wrap [](`~pins.boards.BaseBoard.pin_write`) and [](`~pins.boards.BaseBoard.pin_read`) for your particular use case.

Expand Down
9 changes: 4 additions & 5 deletions pins/boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ def pin_meta(self, name, version: str = None) -> Meta:
# ensure pin and version exist
if not self.fs.exists(self.construct_path([pin_name, version])):
raise PinsError(
f"Pin {name} either does not exist, "
f"or is missing version: {version}."
f"Pin {name} either does not exist, or is missing version: {version}."
)

selected_version = guess_version(version)
Expand Down Expand Up @@ -197,7 +196,7 @@ def pin_read(self, name, version: str | None = None, hash: str | None = None):
A specific pin version to retrieve.
hash:
A hash used to validate the retrieved pin data. If specified, it is
compared against the `pin_hash` field retrived by [](`~pins.boards.BaseBoard.pin_meta`).
compared against the `pin_hash` field retrieved by [](`~pins.boards.BaseBoard.pin_meta`).

"""
meta = self.pin_fetch(name, version)
Expand Down Expand Up @@ -261,7 +260,7 @@ def _pin_store(

pin_name = self.path_to_pin(name)

# Pre-emptively fetch the most recent pin's meta if it exists - this is used
# Preemptively fetch the most recent pin's meta if it exists - this is used
# for the force_identical_write check
abort_if_identical = not force_identical_write and self.pin_exists(name)
if abort_if_identical:
Expand Down Expand Up @@ -416,7 +415,7 @@ def pin_download(self, name, version=None, hash=None) -> Sequence[str]:
A specific pin version to retrieve.
hash:
A hash used to validate the retrieved pin data. If specified, it is
compared against the `pin_hash` field retrived by [](`~pins.boards.BaseBoard.pin_meta`).
compared against the `pin_hash` field retrieved by [](`~pins.boards.BaseBoard.pin_meta`).

"""

Expand Down
2 changes: 1 addition & 1 deletion pins/rsconnect/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def delete_content_item(self, guid: str) -> None:
Note that this method returns None if successful. Otherwise, it raises an error.
"""

# if deletion is sucessful, then it will return an empty body, so we
# if deletion is successful, then it will return an empty body, so we
# need to check the response manually.
r = self.query_v1(f"content/{guid}", "DELETE", return_request=True)

Expand Down
4 changes: 2 additions & 2 deletions pins/rsconnect/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

def _not_impl_args_kwargs(args, kwargs):
return NotImplementedError(
"Additional args and kwargs not supported." f"\nArgs: {args}\nKwargs: {kwargs}"
f"Additional args and kwargs not supported.\nArgs: {args}\nKwargs: {kwargs}"
)


Expand Down Expand Up @@ -209,7 +209,7 @@ def put(

if not (Path(lpath) / "manifest.json").exists():
# TODO(question): does R pins copy content to tmp directory, or
# insert mainfest.json into the source directory?
# insert manifest.json into the source directory?
cls_manifest.add_manifest_to_directory(lpath)

bundle = self.api.post_content_bundle(content["guid"], lpath)
Expand Down
2 changes: 1 addition & 1 deletion pins/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def http_example_board_path():
# backend = BoardBuilder("s3")
# yield backend.create_tmp_board(str(PATH_TO_EXAMPLE_BOARD.absolute())).board
# backend.teardown()
# TODO: could putting it in a publically available bucket folder
# TODO: could putting it in a publicly available bucket folder
return (
"https://raw.githubusercontent.com/machow/pins-python/main/pins/tests/pins-compat"
)
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ universal = 1
[tool.pytest.ini_options]
markers = [
"fs_file: mark test to only run on local filesystem",
"fs_s3: mark test to only run on AWS S3 bucket filesytem",
"fs_s3: mark test to only run on AWS S3 bucket filesystem",
"fs_gcs: mark test to only run on Google Cloud Storage bucket filesystem",
"fs_abfs: mark test to only run on Azure Datalake filesystem",
"fs_rsc: mark test to only run on Posit Connect filesystem",
Expand Down Expand Up @@ -127,3 +127,6 @@ ignore = [
"E501", # Line too long
"A002", # The pins interface includes builtin names in args, e.g. hash, id, etc.
]

[tool.codespell]
skip = ["*.js"]
Loading