Build(deps): Bump leynos/shared-actions/.github/actions/generate-coverage from 4d696e72fff6db49f34302ccf119ba978f1032c9 to 57a33fa65e329db7edc81ece661f1a2e1d39868f - #21
Open
Conversation
* Enforce slots for closed dataclasses (#11) Add binding-aware recognition and conservative safety analysis for standard-library dataclasses whose instance layout can be closed safely. Cover open-state evidence, class identity hazards, and inherited layouts with example, property, plug-in, and PyPy shim tests. Reserve `R9111` for the issue's new rule and move the existing `prefer-type-statement` refactor message to `R9112`. * Document the closed-dataclass slots policy (#11) Explain the literal slots requirement, evidence-based safety exemptions, and explicit compatibility suppression path. Record the binding, decorator-order, and cached layout analysis used by the checker. Update the public inventory to thirteen messages and identify the renumbered type-statement rule as `R9112`. * Fix transitive dataclass layout analysis (#11) Treat fields from the full inherited lineage as declared state, so safe grandparent-field assignments remain eligible for generated slots. Classify manual slots from Astroid's resolved layout rather than from the presence of an assignment, keeping multiple empty-slot marker bases layout-neutral. * Simplify dataclass safety analysis Extract the open-state, class-hazard, and reverse-inheritance decisions into focused helpers. This preserves the conservative checker behaviour while keeping the new analysis within the repository's complexity thresholds. * Fix dataclass slot safety analysis (#11) Restrict declared instance state to real dataclass fields and explicit slots, and require manual slot declarations to have a runtime value. Preserve inherited dictionaries through generated-slot bases and limit reverse multiple-inheritance suppression to genuinely conflicting slot lineages. * Harden dataclass slots analysis (#11) Preserve conservative layout and import-resolution behaviour while fixing the review findings around declared state, generic extension bases, inheritance, recursive analysis, and manual slots. Strengthen diagnostic tests, document the 0.2.0 message migration, and bind Pylint to the supported major-version range. * Recognize nested dataclass slot hazards (#11) Inspect nested executable scopes for replacement-class closures and treat `typing_extensions` ClassVar and Protocol imports like their standard-library counterparts. Document the extracted inference helper and strengthen message-ID coverage. * Cache inherited dataclass layouts (#11) Memoize local inherited-layout classifications per module and clear the provisional cache before final eligibility analysis. Add a structural scaling regression for deep single-inheritance chains. Record the conservative analysis and Pylint compatibility decisions in ADR 001 and link them from the developer documentation. * Fix ADR spelling (#11) Use the project Oxford spelling required by the documentation gate. * Bound dataclass analysis traversal (#11) Stop class-cell scans at nested class boundaries and consume at most two inference candidates when deciding ambiguity. Add focused regressions for nested helper classes and unbounded inference streams. * Validate manual dataclass slots (#11) Require manual `__slots__` declarations to resolve unambiguously to a complete valid slot value before suppressing R9111. Use the validated names for inherited layout and declared-state analysis, and document and test the rejected annotation-only, invalid, unresolved, and ambiguous forms. * Separate manual slot validation stages (#11) Split inferred value classification from element validation so each helper has one decision level while preserving the conservative R9111 behaviour. * Make dataclass checker returns explicit (#11) Add terminal bare returns to the checker lifecycle methods and narrowly suppress the conflicting redundant-return rules where necessary. * Treat manual __dict__ slots as unsafe (#11) A manual `__slots__` entry naming `__dict__` keeps the instance dictionary alive, so the layout is not closed. Classify such a layout as `Layout.UNSAFE` before it can be read as `SLOTTED`, which stops R9111 firing on a dataclass child of a local base that declares `__slots__ = ("__dict__",)`. Mark `DataclassSlotsChecker.__init__` with `typing.override`, keeping the existing `disable-next` comment immediately before the `def` so it still applies. The name is bound through a `TYPE_CHECKING` branch: type checkers see `typing.override` precisely, while the runtime fallback keeps the plugin importable under the PyPy 3.11 pylint shim, where `typing.override` is absent. Rewrite the ADR decision statement impersonally, and correct the developer guide's account of the replacement-class scan: it enters nested executable scopes but stops at nested `ClassDef` bodies, since a nested helper class owns its own class cell. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Clarify unsafe manual-slot regression (#11) * Allow documented external spelling Accept the `LayoutAnalyzer` identifier and literal external API terms so the generated spelling configuration validates the documentation. * Cache inherited dataclass state (#11) Reuse each class's declared state while analysing local inheritance so deep dataclass chains avoid repeated ancestor walks. --------- Co-authored-by: leynos <leynos@rohga> Co-authored-by: leynos <leynos@troubledskies.net> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
…rage Bumps [leynos/shared-actions/.github/actions/generate-coverage](https://github.com/leynos/shared-actions) from 4d696e72fff6db49f34302ccf119ba978f1032c9 to 57a33fa65e329db7edc81ece661f1a2e1d39868f. - [Release notes](https://github.com/leynos/shared-actions/releases) - [Commits](leynos/shared-actions@4d696e7...57a33fa) --- updated-dependencies: - dependency-name: leynos/shared-actions/.github/actions/generate-coverage dependency-version: 57a33fa65e329db7edc81ece661f1a2e1d39868f dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
There was a problem hiding this comment.
Sorry @dependabot[bot], you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bumps leynos/shared-actions/.github/actions/generate-coverage from 4d696e72fff6db49f34302ccf119ba978f1032c9 to 57a33fa65e329db7edc81ece661f1a2e1d39868f.
Commits
57a33faBuild(deps): bump the github-actions group with 3 updates (#410)7576833chore: ignore agent tool and editor artefacts1014f0cBuild(deps): bump the github-actions group across 1 directory with 7 updates ...8add2d9Strip semver pre-release metadata when resolving MSI versions (#405) (#406)2f90d10Skip inapplicable CodeScene coverage checks and surface diagnostics (#395) (#...47b337eAdd rustflags passthrough to setup-rust and rust-build-release (#391)19a7f5dGroup github-actions Dependabot updates into a single PR36eb051Document Python docstring conventions (#392)dca6131Teach PEP 735 development dependency groups6b9dc1bFormat Markdown sourcesDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)