Skip to content

refactor(ipa): simplyfy bool expression using DeMorgan's law - #1547

Merged
andreaangiolillo merged 1 commit into
mainfrom
rerefactor_singleton_ipa
Oct 8, 2026
Merged

andreaangiolillo merged 1 commit into
mainfrom
rerefactor_singleton_ipa

Conversation

@andreaangiolillo

@andreaangiolillo andreaangiolillo commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Proposed changes

This PR makes a small logic simplification to the IPA113SingletonHasUpdateMethod Spectral rule function to improve readability.

@andreaangiolillo
andreaangiolillo requested a balanced review from Copilot October 8, 2026 10:55
@andreaangiolillo andreaangiolillo changed the title refactor: simplyfy bool expression using DeMorgan's law refactor(ipa): simplyfy bool expression using DeMorgan's law Oct 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The implementation is behaviorally unchanged, contrary to the logic correction claimed in the PR description.

1 open finding
What changed in this PR

Refactors the IPA-113 singleton eligibility condition using De Morgan’s law without changing behavior.

Changes:

  • Rewrites the boolean condition into an equivalent, flatter expression.
File Description
tools/​spectral/​ipa/​rulesets/​functions/​IPA113SingletonHasUpdateMethod.js Simplifies the singleton eligibility guard.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

const resourcePathItems = getResourcePathItems(resourcePath, oas.paths);

if (!(isResourceCollectionIdentifier(resourcePath) && isSingletonResource(resourcePathItems))) {
if (!isResourceCollectionIdentifier(resourcePath) || !isSingletonResource(resourcePathItems)) {
@andreaangiolillo
andreaangiolillo marked this pull request as ready for review October 8, 2026 10:58
@andreaangiolillo
andreaangiolillo requested a review from a team as a code owner October 8, 2026 10:58
@andreaangiolillo
andreaangiolillo enabled auto-merge (squash) October 8, 2026 11:00

@andmatei andmatei left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@andreaangiolillo
andreaangiolillo merged commit 2ff7ba0 into main Oct 8, 2026
15 of 16 checks passed
@andreaangiolillo
andreaangiolillo deleted the rerefactor_singleton_ipa branch October 8, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants