Skip to content

Commit 8669b6d

Browse files
Fix pluralization of *_bitbucket_pipelines_config functions (#1072)
1 parent 60bf7d9 commit 8669b6d

4 files changed

Lines changed: 17 additions & 17 deletions

File tree

src/usethis/_core/ci.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
from usethis._console import how_print, info_print
44
from usethis._integrations.ci.bitbucket.config import (
5-
add_bitbucket_pipeline_config,
6-
remove_bitbucket_pipeline_config,
5+
add_bitbucket_pipelines_config,
6+
remove_bitbucket_pipelines_config,
77
)
88
from usethis._tool.impl.codespell import CodespellTool
99
from usethis._tool.impl.deptry import DeptryTool
@@ -37,7 +37,7 @@ def use_ci_bitbucket(*, remove: bool = False, how: bool = False) -> None:
3737
or use_codespell
3838
)
3939

40-
add_bitbucket_pipeline_config(report_placeholder=not use_any_tool)
40+
add_bitbucket_pipelines_config(report_placeholder=not use_any_tool)
4141

4242
if use_pre_commit:
4343
PreCommitTool().update_bitbucket_steps()
@@ -54,7 +54,7 @@ def use_ci_bitbucket(*, remove: bool = False, how: bool = False) -> None:
5454

5555
print_how_to_use_ci_bitbucket()
5656
else:
57-
remove_bitbucket_pipeline_config()
57+
remove_bitbucket_pipelines_config()
5858

5959

6060
def print_how_to_use_ci_bitbucket() -> None:

src/usethis/_integrations/ci/bitbucket/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from usethis._integrations.ci.bitbucket.steps import add_placeholder_step_in_default
44

55

6-
def add_bitbucket_pipeline_config(report_placeholder: bool = True) -> None:
6+
def add_bitbucket_pipelines_config(report_placeholder: bool = True) -> None:
77
"""Add a Bitbucket pipeline configuration.
88
99
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:
1515
add_placeholder_step_in_default(report_placeholder=report_placeholder)
1616

1717

18-
def remove_bitbucket_pipeline_config() -> None:
18+
def remove_bitbucket_pipelines_config() -> None:
1919
if not (usethis_config.cpd() / "bitbucket-pipelines.yml").exists():
2020
# Early exit; the file already doesn't exist
2121
return

tests/usethis/_integrations/ci/bitbucket/test_bitbucket_config.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
from usethis._integrations.ci.bitbucket.anchor import ScriptItemAnchor
44
from usethis._integrations.ci.bitbucket.config import (
5-
add_bitbucket_pipeline_config,
6-
remove_bitbucket_pipeline_config,
5+
add_bitbucket_pipelines_config,
6+
remove_bitbucket_pipelines_config,
77
)
88
from usethis._integrations.ci.bitbucket.schema import Model, Script
99
from usethis._integrations.ci.bitbucket.steps import (
@@ -18,7 +18,7 @@
1818
class TestAddBitbucketPipelineConfig:
1919
def test_blank_slate(self, uv_init_dir: Path):
2020
with change_cwd(uv_init_dir), PyprojectTOMLManager():
21-
add_bitbucket_pipeline_config()
21+
add_bitbucket_pipelines_config()
2222

2323
assert (uv_init_dir / "bitbucket-pipelines.yml").exists()
2424
content = (uv_init_dir / "bitbucket-pipelines.yml").read_text()
@@ -50,7 +50,7 @@ def test_existing_file(self, tmp_path: Path):
5050
(tmp_path / "bitbucket-pipelines.yml").write_text("existing content")
5151

5252
with change_cwd(tmp_path):
53-
add_bitbucket_pipeline_config()
53+
add_bitbucket_pipelines_config()
5454

5555
assert (tmp_path / "bitbucket-pipelines.yml").exists()
5656
content = (tmp_path / "bitbucket-pipelines.yml").read_text()
@@ -59,7 +59,7 @@ def test_existing_file(self, tmp_path: Path):
5959
def test_satisfies_schema(self, uv_init_dir: Path):
6060
# Act
6161
with change_cwd(uv_init_dir), PyprojectTOMLManager():
62-
add_bitbucket_pipeline_config()
62+
add_bitbucket_pipelines_config()
6363
add_bitbucket_step_in_default(
6464
Step(
6565
name="Example step",
@@ -77,14 +77,14 @@ def test_satisfies_schema(self, uv_init_dir: Path):
7777
class TestRemoveBitbucketPipelineConfig:
7878
def test_blank_slate(self, tmp_path: Path):
7979
with change_cwd(tmp_path):
80-
remove_bitbucket_pipeline_config()
80+
remove_bitbucket_pipelines_config()
8181

8282
assert not (tmp_path / "bitbucket-pipelines.yml").exists()
8383

8484
def test_existing_file(self, tmp_path: Path):
8585
(tmp_path / "bitbucket-pipelines.yml").touch()
8686

8787
with change_cwd(tmp_path):
88-
remove_bitbucket_pipeline_config()
88+
remove_bitbucket_pipelines_config()
8989

9090
assert not (tmp_path / "bitbucket-pipelines.yml").exists()

tests/usethis/_integrations/ci/bitbucket/test_cache.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
get_cache_by_name,
88
remove_cache,
99
)
10-
from usethis._integrations.ci.bitbucket.config import add_bitbucket_pipeline_config
10+
from usethis._integrations.ci.bitbucket.config import add_bitbucket_pipelines_config
1111
from usethis._integrations.ci.bitbucket.schema import Cache, CachePath
1212
from usethis._integrations.file.pyproject_toml.io_ import PyprojectTOMLManager
1313
from usethis._test import change_cwd
@@ -19,7 +19,7 @@ def test_in_caches(self, uv_init_dir: Path, capfd: pytest.CaptureFixture[str]):
1919
cache_by_name = {"example": Cache(CachePath("~/.cache/example"))}
2020

2121
with change_cwd(uv_init_dir), PyprojectTOMLManager():
22-
add_bitbucket_pipeline_config()
22+
add_bitbucket_pipelines_config()
2323
capfd.readouterr()
2424

2525
# Act
@@ -42,7 +42,7 @@ def test_already_exists(self, uv_init_dir: Path):
4242

4343
# Act
4444
with change_cwd(uv_init_dir), PyprojectTOMLManager():
45-
add_bitbucket_pipeline_config()
45+
add_bitbucket_pipelines_config()
4646
add_caches(cache_by_name)
4747

4848
# Assert
@@ -125,7 +125,7 @@ def test_removal_succeeds(self, tmp_path: Path, capfd: pytest.CaptureFixture[str
125125
def test_roundtrip(self, uv_init_dir: Path):
126126
with change_cwd(uv_init_dir), PyprojectTOMLManager():
127127
# Arrange
128-
add_bitbucket_pipeline_config()
128+
add_bitbucket_pipelines_config()
129129
add_caches({"mycache": Cache(CachePath("~/.cache/mytool"))})
130130

131131
# Act

0 commit comments

Comments
 (0)