Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@camc314
Copy link
Contributor

@camc314 camc314 commented Oct 23, 2025

TL;DR

Fixed a bug in the strict-boolean-expressions rule by making the traversedNodes set local to each rule execution.

What changed?

Moved the traversedNodes set from a package-level variable to a local variable within the rule's Run function. Updated all traversal functions to accept this set as a parameter, ensuring that each rule execution has its own isolated set of traversed nodes.

How to test?

Run the linter on code with multiple files containing boolean expressions. Verify that the rule correctly identifies issues in each file independently without being affected by previously traversed nodes from other files.

Why make this change?

The previous implementation used a global traversedNodes set, which could cause issues when linting multiple files as nodes from one file could prevent proper traversal in subsequent files. This change ensures each rule execution has its own clean state, preventing cross-file interference and potential false negatives.

@camc314 camc314 marked this pull request as ready for review October 23, 2025 20:42
Copy link
Contributor Author

camc314 commented Oct 23, 2025


How to use the Graphite Merge Queue

Add the label 0-merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@camc314 camc314 force-pushed the c/10-23-fix_strict-boolean-expressions_fix_memory_leak branch from 17a6a1b to b565c34 Compare October 24, 2025 10:40
@camc314 camc314 self-assigned this Oct 24, 2025
@graphite-app
Copy link

graphite-app bot commented Oct 24, 2025

Merge activity

### TL;DR

Fixed a bug in the `strict-boolean-expressions` rule by making the `traversedNodes` set local to each rule execution.

### What changed?

Moved the `traversedNodes` set from a package-level variable to a local variable within the rule's `Run` function. Updated all traversal functions to accept this set as a parameter, ensuring that each rule execution has its own isolated set of traversed nodes.

### How to test?

Run the linter on code with multiple files containing boolean expressions. Verify that the rule correctly identifies issues in each file independently without being affected by previously traversed nodes from other files.

### Why make this change?

The previous implementation used a global `traversedNodes` set, which could cause issues when linting multiple files as nodes from one file could prevent proper traversal in subsequent files. This change ensures each rule execution has its own clean state, preventing cross-file interference and potential false negatives.
@graphite-app graphite-app bot force-pushed the c/10-23-fix_strict-boolean-expressions_fix_memory_leak branch from b565c34 to 74bd548 Compare October 24, 2025 10:52
@graphite-app graphite-app bot merged commit 74bd548 into main Oct 24, 2025
6 checks passed
@graphite-app graphite-app bot deleted the c/10-23-fix_strict-boolean-expressions_fix_memory_leak branch October 24, 2025 11:03
@graphite-app graphite-app bot removed the 0-merge label Oct 24, 2025
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