Skip to content

refactor: "for loop" - argv to config; in main_executor.js - #183

Draft
Pranav-yadav wants to merge 1 commit into
0xPolygon:mainfrom
Pranav-yadav:patch-1
Draft

refactor: "for loop" - argv to config; in main_executor.js#183
Pranav-yadav wants to merge 1 commit into
0xPolygon:mainfrom
Pranav-yadav:patch-1

Conversation

@Pranav-yadav

Copy link
Copy Markdown
  • 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;

- 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;`
@cla-bot

cla-bot Bot commented Mar 30, 2023

Copy link
Copy Markdown

We require contributors/corporates @Pranav-yadav to read our Contributor License Agreement, please check the Individual CLA document/Corporate CLA document

Comment thread src/main_executor.js
Comment on lines +116 to 118
for (const value of ['debug', 'unsigned', 'execute', 'tracer', 'counters', 'skip', 'verbose']) {
config[value] ||= argv[value] === true;
}

@Pranav-yadav Pranav-yadav Mar 30, 2023

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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;
});

@Pranav-yadav

Copy link
Copy Markdown
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?
@zkronos73 sorry for the extra ping, but the CLA flow is confusing here...

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@krlosMata
krlosMata marked this pull request as draft March 4, 2024 14:54
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.

1 participant