From 6150d438b3b494b07da1eff42fd5c4a73f2433ca Mon Sep 17 00:00:00 2001 From: Nathan McDougall Date: Sat, 1 Nov 2025 15:01:03 +1300 Subject: [PATCH] Fix pluralization of `*_bitbucket_pipelines_config` functions --- src/usethis/_core/ci.py | 8 ++++---- src/usethis/_integrations/ci/bitbucket/config.py | 4 ++-- .../ci/bitbucket/test_bitbucket_config.py | 14 +++++++------- .../_integrations/ci/bitbucket/test_cache.py | 8 ++++---- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/usethis/_core/ci.py b/src/usethis/_core/ci.py index cd71e733..ab889021 100644 --- a/src/usethis/_core/ci.py +++ b/src/usethis/_core/ci.py @@ -2,8 +2,8 @@ from usethis._console import how_print, info_print from usethis._integrations.ci.bitbucket.config import ( - add_bitbucket_pipeline_config, - remove_bitbucket_pipeline_config, + add_bitbucket_pipelines_config, + remove_bitbucket_pipelines_config, ) from usethis._tool.impl.codespell import CodespellTool from usethis._tool.impl.deptry import DeptryTool @@ -37,7 +37,7 @@ def use_ci_bitbucket(*, remove: bool = False, how: bool = False) -> None: or use_codespell ) - add_bitbucket_pipeline_config(report_placeholder=not use_any_tool) + add_bitbucket_pipelines_config(report_placeholder=not use_any_tool) if use_pre_commit: PreCommitTool().update_bitbucket_steps() @@ -54,7 +54,7 @@ def use_ci_bitbucket(*, remove: bool = False, how: bool = False) -> None: print_how_to_use_ci_bitbucket() else: - remove_bitbucket_pipeline_config() + remove_bitbucket_pipelines_config() def print_how_to_use_ci_bitbucket() -> None: diff --git a/src/usethis/_integrations/ci/bitbucket/config.py b/src/usethis/_integrations/ci/bitbucket/config.py index 82a682c5..ba6e2ca2 100644 --- a/src/usethis/_integrations/ci/bitbucket/config.py +++ b/src/usethis/_integrations/ci/bitbucket/config.py @@ -3,7 +3,7 @@ from usethis._integrations.ci.bitbucket.steps import add_placeholder_step_in_default -def add_bitbucket_pipeline_config(report_placeholder: bool = True) -> None: +def add_bitbucket_pipelines_config(report_placeholder: bool = True) -> None: """Add a Bitbucket pipeline configuration. Note that the pipeline is empty and will need steps added to it to run successfully. @@ -15,7 +15,7 @@ def add_bitbucket_pipeline_config(report_placeholder: bool = True) -> None: add_placeholder_step_in_default(report_placeholder=report_placeholder) -def remove_bitbucket_pipeline_config() -> None: +def remove_bitbucket_pipelines_config() -> None: if not (usethis_config.cpd() / "bitbucket-pipelines.yml").exists(): # Early exit; the file already doesn't exist return diff --git a/tests/usethis/_integrations/ci/bitbucket/test_bitbucket_config.py b/tests/usethis/_integrations/ci/bitbucket/test_bitbucket_config.py index c79f59ef..11cfc586 100644 --- a/tests/usethis/_integrations/ci/bitbucket/test_bitbucket_config.py +++ b/tests/usethis/_integrations/ci/bitbucket/test_bitbucket_config.py @@ -2,8 +2,8 @@ from usethis._integrations.ci.bitbucket.anchor import ScriptItemAnchor from usethis._integrations.ci.bitbucket.config import ( - add_bitbucket_pipeline_config, - remove_bitbucket_pipeline_config, + add_bitbucket_pipelines_config, + remove_bitbucket_pipelines_config, ) from usethis._integrations.ci.bitbucket.schema import Model, Script from usethis._integrations.ci.bitbucket.steps import ( @@ -18,7 +18,7 @@ class TestAddBitbucketPipelineConfig: def test_blank_slate(self, uv_init_dir: Path): with change_cwd(uv_init_dir), PyprojectTOMLManager(): - add_bitbucket_pipeline_config() + add_bitbucket_pipelines_config() assert (uv_init_dir / "bitbucket-pipelines.yml").exists() content = (uv_init_dir / "bitbucket-pipelines.yml").read_text() @@ -50,7 +50,7 @@ def test_existing_file(self, tmp_path: Path): (tmp_path / "bitbucket-pipelines.yml").write_text("existing content") with change_cwd(tmp_path): - add_bitbucket_pipeline_config() + add_bitbucket_pipelines_config() assert (tmp_path / "bitbucket-pipelines.yml").exists() content = (tmp_path / "bitbucket-pipelines.yml").read_text() @@ -59,7 +59,7 @@ def test_existing_file(self, tmp_path: Path): def test_satisfies_schema(self, uv_init_dir: Path): # Act with change_cwd(uv_init_dir), PyprojectTOMLManager(): - add_bitbucket_pipeline_config() + add_bitbucket_pipelines_config() add_bitbucket_step_in_default( Step( name="Example step", @@ -77,7 +77,7 @@ def test_satisfies_schema(self, uv_init_dir: Path): class TestRemoveBitbucketPipelineConfig: def test_blank_slate(self, tmp_path: Path): with change_cwd(tmp_path): - remove_bitbucket_pipeline_config() + remove_bitbucket_pipelines_config() assert not (tmp_path / "bitbucket-pipelines.yml").exists() @@ -85,6 +85,6 @@ def test_existing_file(self, tmp_path: Path): (tmp_path / "bitbucket-pipelines.yml").touch() with change_cwd(tmp_path): - remove_bitbucket_pipeline_config() + remove_bitbucket_pipelines_config() assert not (tmp_path / "bitbucket-pipelines.yml").exists() diff --git a/tests/usethis/_integrations/ci/bitbucket/test_cache.py b/tests/usethis/_integrations/ci/bitbucket/test_cache.py index 97f2ff4c..676e497b 100644 --- a/tests/usethis/_integrations/ci/bitbucket/test_cache.py +++ b/tests/usethis/_integrations/ci/bitbucket/test_cache.py @@ -7,7 +7,7 @@ get_cache_by_name, remove_cache, ) -from usethis._integrations.ci.bitbucket.config import add_bitbucket_pipeline_config +from usethis._integrations.ci.bitbucket.config import add_bitbucket_pipelines_config from usethis._integrations.ci.bitbucket.schema import Cache, CachePath from usethis._integrations.file.pyproject_toml.io_ import PyprojectTOMLManager from usethis._test import change_cwd @@ -19,7 +19,7 @@ def test_in_caches(self, uv_init_dir: Path, capfd: pytest.CaptureFixture[str]): cache_by_name = {"example": Cache(CachePath("~/.cache/example"))} with change_cwd(uv_init_dir), PyprojectTOMLManager(): - add_bitbucket_pipeline_config() + add_bitbucket_pipelines_config() capfd.readouterr() # Act @@ -42,7 +42,7 @@ def test_already_exists(self, uv_init_dir: Path): # Act with change_cwd(uv_init_dir), PyprojectTOMLManager(): - add_bitbucket_pipeline_config() + add_bitbucket_pipelines_config() add_caches(cache_by_name) # Assert @@ -125,7 +125,7 @@ def test_removal_succeeds(self, tmp_path: Path, capfd: pytest.CaptureFixture[str def test_roundtrip(self, uv_init_dir: Path): with change_cwd(uv_init_dir), PyprojectTOMLManager(): # Arrange - add_bitbucket_pipeline_config() + add_bitbucket_pipelines_config() add_caches({"mycache": Cache(CachePath("~/.cache/mytool"))}) # Act