Page MenuHomePhabricator

Apply clang formatting on newest master - Java files affected
ClosedPublic

Authored by marcin on Dec 28 2022, 3:05 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 4, 11:21 PM
Unknown Object (File)
Mon, Nov 4, 11:21 PM
Unknown Object (File)
Mon, Nov 4, 11:21 PM
Unknown Object (File)
Mon, Nov 4, 11:21 PM
Unknown Object (File)
Mon, Nov 4, 11:20 PM
Unknown Object (File)
Mon, Nov 4, 4:21 AM
Unknown Object (File)
Mon, Nov 4, 4:20 AM
Unknown Object (File)
Mon, Nov 4, 4:20 AM
Subscribers

Details

Summary

In the course of work on react-native-notifications replacement on iOS I used yarn clang-format-all and it happened to format one Java file i didn't touch.

Test Plan

Without applying this diff run yarn clang-format-all and ensure created changes are equal to this differential

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Rebase to add diff to commit description

Ah yeah, this is my fault. I disabled precommit hooks while working on my React Native stack due to Flow errors, which also meant that clang-format didn't get called.

Separately – running yarn clang-format-all is generally an anti-pattern (similar to running eg. eslint --fix .), since our precommit hooks should format things automatically. Was there anything that the precommit hooks were missing? Or maybe you were using git commit --no-verify or otherwise disabling precommit hooks while developing?

This revision is now accepted and ready to land.Dec 28 2022, 6:25 AM

(Adding clang-format check to CI would be pretty straightforward)

Agree that all precommit hooks should also be on CI

Ah yeah, this is my fault. I disabled precommit hooks while working on my React Native stack due to Flow errors, which also meant that clang-format didn't get called.

Separately – running yarn clang-format-all is generally an anti-pattern (similar to running eg. eslint --fix .), since our precommit hooks should format things automatically. Was there anything that the precommit hooks were missing? Or maybe you were using git commit --no-verify or otherwise disabling precommit hooks while developing?

Our pre-commit hooks neither miss anything nor were I using git commit --no-verify. I run yarn clang-format-all frequently during coding since it makes code more readable and comfortable to work with.

You should not need to submit any diffs with the results of running that command if precommit hooks are working correctly. That command should result in no changes since precommit hooks make sure all code is formatted correctly.