Skip to content

Commit d9b6248

Browse files
committed
ci: add slophammer baseline gate
1 parent 8fc3353 commit d9b6248

6 files changed

Lines changed: 66 additions & 5 deletions

File tree

.github/workflows/slophammer.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Slophammer
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
check:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v6
17+
- uses: astral-sh/setup-uv@v7
18+
- name: Run Slophammer
19+
run: uvx slophammer-py@0.3.0 check . --baseline

AGENTS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# AGENTS.md
2+
3+
These instructions apply to this repository.
4+
5+
- Keep generated changes small and reviewable by maintainers.
6+
- Preserve the public package API unless the change is explicitly scoped as breaking.
7+
- Add or update tests when changing behavior.
8+
- Run the relevant local checks before submitting a change.
9+
- Use the existing project style and avoid unrelated formatting churn.

manim_voiceover/helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def chunks(lst: list, n: int):
1818

1919

2020
def remove_bookmarks(input: str) -> str:
21-
return re.sub("<bookmark\s*mark\s*=['\"]\w*[\"']\s*/>", "", input)
21+
return re.sub(r"<bookmark\s*mark\s*=['\"]\w*[\"']\s*/>", "", input)
2222

2323

2424
def wav2mp3(wav_path, mp3_path=None, remove_wav=True, bitrate="312k"):

manim_voiceover/py.typed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

manim_voiceover/services/elevenlabs.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ def generate_from_text(
149149
path: Optional[str] = None,
150150
**kwargs,
151151
) -> dict:
152-
if cache_dir is None:
153-
cache_dir = self.cache_dir # type: ignore
152+
cache_dir_path = Path(cache_dir) if cache_dir is not None else Path(self.cache_dir)
154153

155154
input_text = remove_bookmarks(text)
156155
input_data = {
@@ -163,7 +162,7 @@ def generate_from_text(
163162
}
164163

165164
# if not config.disable_caching:
166-
cached_result = self.get_cached_result(input_data, cache_dir)
165+
cached_result = self.get_cached_result(input_data, cache_dir_path)
167166

168167
if cached_result is not None:
169168
return cached_result
@@ -180,7 +179,7 @@ def generate_from_text(
180179
model=self.model,
181180
output_format=self.output_format,
182181
)
183-
save(audio, str(Path(cache_dir) / audio_path)) # type: ignore
182+
save(audio, str(cache_dir_path / audio_path))
184183
except Exception as e:
185184
logger.error(e)
186185
raise Exception("Failed to initialize ElevenLabs.")

slophammer-baseline.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"version": 1,
3+
"findings": [
4+
{
5+
"rule_id": "py.complexity-required",
6+
"path": "pyproject.toml"
7+
},
8+
{
9+
"rule_id": "py.coverage-required",
10+
"path": ".github/workflows"
11+
},
12+
{
13+
"rule_id": "py.dependency-audit-required",
14+
"path": ".github/workflows"
15+
},
16+
{
17+
"rule_id": "py.dry-required",
18+
"path": ".github/workflows"
19+
},
20+
{
21+
"rule_id": "py.format-required",
22+
"path": ".github/workflows"
23+
},
24+
{
25+
"rule_id": "py.mutation-required",
26+
"path": ".github/workflows"
27+
},
28+
{
29+
"rule_id": "py.typecheck-required",
30+
"path": ".github/workflows"
31+
}
32+
]
33+
}

0 commit comments

Comments
 (0)