Skip to content

Commit 2bddd8a

Browse files
authored
Merge pull request #7 from eccenca/feature/updateTemplate
update to cmem-plugin-template v9.10.0
2 parents 22f458b + f016c59 commit 2bddd8a

6 files changed

Lines changed: 51 additions & 7 deletions

File tree

‎.claude/rules/copier-template.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ reason above it. Neither escape ruff suggests is available, since keyword-only
6060
arguments answer `PLR0917` but not `PLR0913`, and folding the arguments into
6161
one object breaks the one-argument-per-option mapping the framework relies on.
6262

63+
`ARG002` is settled on the same grounds, one argument further in: a method the
64+
framework calls has the signature the framework declares, so an argument the
65+
implementation does not need cannot be dropped - a workflow task with no input
66+
ports never reads `inputs`. Suppress it on the argument, again with the reason
67+
above it. Renaming it to `_inputs` silences ruff as well, and is wrong here:
68+
the name belongs to an API the caller may use by keyword, as this project's own
69+
tests do.
70+
6371
## Every user visible change gets a changelog entry
6472

6573
`CHANGELOG.md` follows [Keep a Changelog](https://keepachangelog.com/). Add an

‎.claude/skills/plugin-implementation/SKILL.md‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,33 @@ start failing on it without anything in the task changing. Suppress it on the
350350
constructor only - it stays a real finding on an ordinary function, which is
351351
why it is not in the `ignore` list in `pyproject.toml`.
352352

353+
## An argument the task never reads
354+
355+
`ARG002` complains about an unused method argument, and a task declaring
356+
`FixedNumberOfInputs([])` generates its own entities - so `execute()` never
357+
reads `inputs`, while `WorkflowPlugin` decides the signature all the same. A
358+
`TransformPlugin` or a `PluginAction` ignoring an argument the framework
359+
supplies is the same case.
360+
361+
This is the standing exception the lint rules describe, so it needs no fresh
362+
decision either. Suppress the code on the argument, with the reason above it:
363+
364+
```python
365+
def execute(
366+
self,
367+
# This task has no input ports, so it never reads inputs - but the
368+
# signature is the one WorkflowPlugin declares.
369+
inputs: Sequence[Entities], # noqa: ARG002
370+
context: ExecutionContext,
371+
) -> Entities:
372+
```
373+
374+
Do not rename it to `_inputs` instead. Ruff accepts the underscore and mypy
375+
permits the rename, but the name is part of the API the caller uses:
376+
`execute(inputs=(), context=TestExecutionContext())` is a keyword call, which is
377+
how `tests/test_example.py` and the `plugin-testing` skill invoke a task, and it
378+
raises `TypeError` against a renamed argument.
379+
353380
## Parameters that carry secrets
354381

355382
A password, token or API key is typed, never a plain string:

‎.copier-answers.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier
2-
_commit: v9.9.0
2+
_commit: v9.10.0
33
_src_path: gh:eccenca/cmem-plugin-template
44
author_mail: cmempy-developer@eccenca.com
55
author_name: eccenca GmbH

‎Taskfile.yaml‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,14 @@ tasks:
164164
deps:
165165
- prepare
166166
cmds:
167+
# .claude/ is skipped because a git worktree created there is a second
168+
# checkout inside the repository, whose lock file is scanned as if it
169+
# were this one - on an older branch, with older findings.
167170
- >
168171
poetry run trivy fs
169172
--include-dev-deps
170173
--scanners vuln
174+
--skip-dirs .claude
171175
--skip-files .poetry/plugins/poetry.lock
172176
--exit-code 1
173177
.
@@ -177,7 +181,12 @@ tasks:
177181
deps:
178182
- prepare
179183
cmds:
180-
- poetry run deptry .
184+
# deptry's default excludes cover a tests directory at the root but not
185+
# a nested copy of one, so the worktree described above would be read as
186+
# source and its test imports reported.
187+
- >
188+
poetry run deptry .
189+
--extend-exclude '\.claude'
181190
182191
check:ruff:
183192
desc: Complain about everything else

‎poetry.lock‎

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pytest-dotenv = "^0.5.2"
4242
pytest-html = "^4.2.0"
4343
pytest-memray = { version = "^1.10.0", markers = "platform_system != 'Windows'" }
4444
ruff = "^0.16.2"
45-
trivy-py-ecc = "^0.73.0.1"
45+
trivy-py-ecc = "^0.76.0.1"
4646

4747
[build-system]
4848
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]

0 commit comments

Comments
 (0)