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

Trott
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
Collaborator

Review requested:

  • @nodejs/crypto

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem. needs-ci PRs that need a full CI run. labels Apr 9, 2022
Comment on lines -274 to +255
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 Add this label to start a Jenkins CI on a PR. label Apr 9, 2022
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Apr 9, 2022
@nodejs-github-bot
Copy link
Collaborator

@RaisinTen
Copy link
Contributor

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 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 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
Contributor

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 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
Contributor

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
@Trott Trott deleted the formatting branch September 25, 2022 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants