refactor: "for loop" - argv to config; in main_executor.js - #183
Draft
Pranav-yadav wants to merge 1 commit into
Draft
refactor: "for loop" - argv to config; in main_executor.js#183Pranav-yadav wants to merge 1 commit into
main_executor.js#183Pranav-yadav wants to merge 1 commit into
Conversation
- use `const` for the loop variable, as it's *not* modified in the body - use shorthand syntax for: `config[value] = (argv[value] === true ? true : (config[value] ?? false));` as; `config[value] ||= argv[value] === true;`
|
We require contributors/corporates @Pranav-yadav to read our Contributor License Agreement, please check the Individual CLA document/Corporate CLA document |
Pranav-yadav
commented
Mar 30, 2023
Comment on lines
+116
to
118
| for (const value of ['debug', 'unsigned', 'execute', 'tracer', 'counters', 'skip', 'verbose']) { | ||
| config[value] ||= argv[value] === true; | ||
| } |
Author
There was a problem hiding this comment.
Though, not that it's better or worse, I would use even more specific syntax like below; @zkronos73 WDYT?
Suggested change
| for (const value of ['debug', 'unsigned', 'execute', 'tracer', 'counters', 'skip', 'verbose']) { | |
| config[value] ||= argv[value] === true; | |
| } | |
| ['debug', 'unsigned', 'execute', 'tracer', 'counters', 'skip', 'verbose'].forEach((value) => { | |
| config[value] ||= argv[value] === true; | |
| }); |
Author
|
Also, what's the exact procedure of signing cla for this repo. I read it. Now what? Is there website where I have to click signed? |
|
Kudos, SonarCloud Quality Gate passed!
|
krlosMata
marked this pull request as draft
March 4, 2024 14:54
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.








constfor the loop variable, as it's not modified in the bodyconfig[value] = (argv[value] === true ? true : (config[value] ?? false));as;config[value] ||= argv[value] === true;