Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix #10263] Fix aliasing problem for Enabled in Config
There was an aliasing problem in the `Config` class causing the `cop_options` local variable to reference the same object between different calls to `for_cop` even when the calls were to different `Config` objects with different `@hash` objects. I have not been able to figure out the root cause. Only that the phenomenon occurs, and that duplicating the cop options before setting the `Enabled` property resolves it.
- Loading branch information
Showing
3 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* [#10263](https://github.com/rubocop/rubocop/pull/10263): Fix the value of `Enabled` leaking between configurations. ([@jonas054][]) |
This file contains 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
This file contains 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