diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f5107949..b32a73e3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/docs/customize-pins-metadata.qmd b/docs/customize-pins-metadata.qmd index 9bea6000..0db2e51e 100644 --- a/docs/customize-pins-metadata.qmd +++ b/docs/customize-pins-metadata.qmd @@ -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. diff --git a/pins/boards.py b/pins/boards.py index 70fc8ba4..0cc99e19 100644 --- a/pins/boards.py +++ b/pins/boards.py @@ -196,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) @@ -260,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: @@ -415,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`). """ diff --git a/pins/rsconnect/api.py b/pins/rsconnect/api.py index 23af7c70..d64e8f12 100644 --- a/pins/rsconnect/api.py +++ b/pins/rsconnect/api.py @@ -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) diff --git a/pins/rsconnect/fs.py b/pins/rsconnect/fs.py index 4855892c..f16a34d9 100644 --- a/pins/rsconnect/fs.py +++ b/pins/rsconnect/fs.py @@ -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}" ) @@ -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) diff --git a/pins/tests/conftest.py b/pins/tests/conftest.py index 0af518fc..6a3690e7 100644 --- a/pins/tests/conftest.py +++ b/pins/tests/conftest.py @@ -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" ) diff --git a/pyproject.toml b/pyproject.toml index 96b24ad5..094b387e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", @@ -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"]