Policy to change clang-format brace placement #75956
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#75956
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Note, this proposal is for when we switch to clang-format 10, which is probably not something that's expected to happen soon.
This task proposes to use clang-format with multi-line brace placement.
This was used for Blender's code-style before using clang-format, however clang-format didn't support differentiating between multi-line and single-lines.
With the release of clang-format 10, this is now supported.
Motivation
Better readability by separating checks from
if
statements and loops with the body of code block.Example:
Before:
After:
Before:
After:
Before:
After:
Tradeoff's
Pros
Cons
Proposal
Enable this option once we've updated to clang-format version 10.
Change to
.clang-format
(with surrounding values omitted).Changed status from 'Needs Triage' to: 'Confirmed'
Added subscriber: @ideasman42
Added subscriber: @Sergey
I see this as a bandage on top of a improperly structured code, and the improved readability is subjective here. The more readable version would be
if (need_initialize_multi_data(...))
and move all those levels of nesting into a function, sue early returns, keep indentation low, describe conditions as needed. And keep the current formatting, so that developers are disguised and are forced to type properly readable code ;)To me this is a disruptive change, which doesn't solve the claimed root issue.
Multi-post spam, yay!
Had a quick chat with Dalai about how to make such reviews don't feel difficult for any of the sides. To come to the consensus, here is my statement: I don't find this proposal great, but I can accept it.
Added subscriber: @mont29
Big +1 from me, that was one of the main issues I had when we switched to Clang-format.
+1, even though the code that reads poorly could be refactored in some cases. There is enough of this that can't/wont be easily changed.
Added subscriber: @brecht
I have no preference, either is fine.
I agree with @Sergey, both on the 'this should be refactored' front and the 'I can live with this' front.
Applied:
.clang-format
:391f86bc38
make format
:6859bb6e67
a0db0a5580