From 9255cc58a9f4c4275653d14af3ff22fdea94c53b Mon Sep 17 00:00:00 2001 From: Yuval Tassa Date: Thu, 24 Aug 2023 07:09:40 -0700 Subject: [PATCH] Update style guide. PiperOrigin-RevId: 559743120 Change-Id: I6073911526bef9a9cc72d95122c4e8b9993b22ba --- STYLEGUIDE.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/STYLEGUIDE.md b/STYLEGUIDE.md index b9a679fb..c6595f6d 100644 --- a/STYLEGUIDE.md +++ b/STYLEGUIDE.md @@ -34,7 +34,7 @@ takes precedence. Additional principles include: - Follow the [naming conventions](https://mujoco.readthedocs.io/en/latest/programming#naming-convention). - Be sparing with horizontal space: Try to keep lines short, avoid line-breaks -where possble. + where possible. - Be generous with vertical space: Empty lines between code blocks are good. - Keep names short. - Inline comments are part of the code, treat them as such. @@ -59,7 +59,7 @@ spot such a pattern, feel free to send a PR to update the guide. Line length is 100 characters. In rare situations, like the collision table at the top of [engine_collision_driver.c](https://github.com/deepmind/mujoco/blob/c8ff7b3d341560e8cc33fbdcaffbcdbc4c32327c/src/engine/engine_collision_driver.c#L36), -longer lines are alowed for readability. +longer lines are allowed for readability. #### Comments @@ -88,8 +88,8 @@ including for one-line blocks: ```C // transpose matrix void mju_transpose(mjtNum* res, const mjtNum* mat, int nr, int nc) { - for (int i=0; i