Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: simplify script/lint.js #37077

Merged
merged 1 commit into from
Jan 31, 2023
Merged

refactor: simplify script/lint.js #37077

merged 1 commit into from
Jan 31, 2023

Conversation

miniak
Copy link
Contributor

@miniak miniak commented Jan 31, 2023

Description of Change

Use this pattern

electron/script/lint.js

Lines 78 to 80 in fcc7a86

const clangFormatFlags = opts.fix ? ['--fix'] : [];
for (const chunk of chunkFilenames(filenames)) {
spawnAndCheckExitCode('python3', ['script/run-clang-format.py', ...clangFormatFlags, ...chunk]);

Instead of duplicating the code

electron/script/lint.js

Lines 89 to 93 in fcc7a86

if (opts.fix) {
spawnAndCheckExitCode('python3', ['script/run-clang-format.py', '-r', '--fix', ...filenames]);
} else {
spawnAndCheckExitCode('python3', ['script/run-clang-format.py', '-r', ...filenames]);
}

Checklist

  • PR description included and stakeholders cc'd
  • npm test passes

Release Notes

Notes: none

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Jan 31, 2023
@miniak miniak self-assigned this Jan 31, 2023
@codebytere codebytere merged commit c6203d5 into main Jan 31, 2023
@codebytere codebytere deleted the miniak/tweak-lint branch January 31, 2023 13:33
@release-clerk
Copy link

release-clerk bot commented Jan 31, 2023

No Release Notes

khalwa pushed a commit to solarwindscloud/electron that referenced this pull request Feb 22, 2023
Co-authored-by: Milan Burda <miburda@microsoft.com>
gecko19 pushed a commit to brightsign/electron that referenced this pull request Feb 28, 2023
Co-authored-by: Milan Burda <miburda@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-pr 🌱 PR opened in the last 24 hours no-backport semver/none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants