Sitelet https://web.archive.org/web/20220418074144/https://github.com/nodejs/node/pull/42668
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

src,crypto: adjust crypto_bio files for formatter/linter #42668

Closed
wants to merge 1 commit into from

Conversation

Copy link
Member

@Trott Trott commented Apr 9, 2022

Run clang-format on the files and provide needed additional comments for
the linter.

Refs: #42665 (comment)

Run clang-format on the files and provide needed additional comments for
the linter.

Refs: nodejs#42665 (comment)
@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Apr 9, 2022

Review requested:

@nodejs-github-bot nodejs-github-bot added c++ crypto needs-ci labels Apr 9, 2022
if (avail > left)
avail = left;
if (avail > left) avail = left;
Copy link
Member Author

@Trott Trott Apr 9, 2022 •

Choose a reason for hiding this comment

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

I find changes like this less readable and I'm guessing I'm not alone. (It further suggests to me that we don't actually use clang-format.) I imagine there's a configuration that could be changed in .clang-format if this is a highly-undesriable change (or we could add { and } which would presumably cause clang-format to leave the block on it's own line, although I haven't tested that).

@Trott Trott added the request-ci label Apr 9, 2022
@github-actions github-actions bot removed the request-ci label Apr 9, 2022
@nodejs-github-bot
Copy link
Contributor

@nodejs-github-bot nodejs-github-bot commented Apr 9, 2022

@RaisinTen
Copy link
Member

@RaisinTen RaisinTen commented Apr 9, 2022

Instead of introducing changes purely to satisfy the linters, what do you think about setting up the clang-format linter on CI first? It should automatically suggest fixes for areas touched by newer PRs.

@Trott
Copy link
Member Author

@Trott Trott commented Apr 9, 2022

Instead of introducing changes purely to satisfy the linters, what do you think about setting up the clang-format linter on CI first? It should automatically suggest fixes for areas touched by newer PRs.

When you say "clang-format linter", do you mean something different than the clang-format Makefile task we have now? For CI, I had planned/imagined running the clang-format job and have it fail if it produced a diff (which is what the markdown formatter does--we run the markdown formatter as part of the markdown lint job and if it produces output that is different from what is in the files that were changed in the PR, it raises an error and tells the person to run the format-md task). That is something we should do. I'm not sure this or other PRs should wait necessarily. I imagine bikeshedding on the rules might take some time. There's #42668 (comment), and the likely bug in one of the rules around pointers/readability, and probably other things.

@Trott
Copy link
Member Author

@Trott Trott commented Apr 9, 2022

I had planned/imagined

Please don't let the "I had planned" part stop you or anyone else from doing this. I very well may never bother to do it.

@RaisinTen
Copy link
Member

@RaisinTen RaisinTen commented Apr 10, 2022

When you say "clang-format linter", do you mean something different than the clang-format Makefile task we have now?

I meant make format-cpp.

Please don't let the "I had planned" part stop you or anyone else from doing this. I very well may never bother to do it.

Sure, sent a PR to run it on CI - #42681.

@Trott
Copy link
Member Author

@Trott Trott commented Apr 10, 2022

@RaisinTen In your opinion, should I mark this as blocked on #42681? Close this entirely? Reduce this to just the changes that the linter needs? Something else?

@RaisinTen
Copy link
Member

@RaisinTen RaisinTen commented Apr 11, 2022

IMO, we should close this PR because landing #42681 should automatically help in fixing the formatting in newer PRs and running clang-format on these files manually would potentially cause more git conflicts and add another git-blame to the logs without much gain.

@Trott Trott closed this Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ crypto needs-ci
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants