Coding - Update Clang-format with more macroses#677
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request updates the Clang-format configuration to better handle specific OCCT macros by adding them to the StatementMacros list and introducing a PowerShell step to remove empty lines after Standard_DEPRECATED macros. The changes improve code formatting consistency across the OCCT codebase.
- Updates
.clang-formatto includeOCC_CATCH_SIGNALS,DEFINE_STANDARD_RTTIEXT, andDraw_Drawable3D_FACTORYas statement macros - Adds a GitHub action step to automatically remove empty lines after
Standard_DEPRECATEDmacro declarations - Reformats numerous files by removing blank lines after deprecated method declarations and improving macro formatting
Reviewed Changes
Copilot reviewed 51 out of 95 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
.clang-format |
Adds new macros to StatementMacros list for better formatting |
.github/actions/clang-format-check/action.yml |
Adds PowerShell script to clean up empty lines after Standard_DEPRECATED |
| Multiple header files | Removes blank lines after Standard_DEPRECATED and reformats macro usage |
| Multiple source files | Reformats OCC_CATCH_SIGNALS macro usage and constructor formatting |
| //============================================================================= | ||
| GeomToStep_MakeLine::GeomToStep_MakeLine(const gp_Lin& L, const StepData_Factors& theLocalFactors) | ||
| { | ||
| GeomToStep_MakeLine::GeomToStep_MakeLine(const gp_Lin& L, const StepData_Factors& theLocalFactors){ |
There was a problem hiding this comment.
Missing space before opening brace. According to OCCT style conventions, there should be a space before the opening brace in function definitions.
| GeomToStep_MakeLine::GeomToStep_MakeLine(const gp_Lin& L, const StepData_Factors& theLocalFactors){ | |
| GeomToStep_MakeLine::GeomToStep_MakeLine(const gp_Lin& L, const StepData_Factors& theLocalFactors) { |
| GeomToStep_MakeLine::GeomToStep_MakeLine(const gp_Lin2d& L, const StepData_Factors& theLocalFactors) | ||
| { | ||
| GeomToStep_MakeLine::GeomToStep_MakeLine(const gp_Lin2d& L, | ||
| const StepData_Factors& theLocalFactors){ |
There was a problem hiding this comment.
Missing space before opening brace. According to OCCT style conventions, there should be a space before the opening brace in function definitions.
| const StepData_Factors& theLocalFactors){ | |
| const StepData_Factors& theLocalFactors) { |
| const Handle(Geom_BSplineCurve)& BS, | ||
| const StepData_Factors& theLocalFactors) | ||
| { | ||
| const StepData_Factors& theLocalFactors){ |
There was a problem hiding this comment.
Missing space before opening brace. According to OCCT style conventions, there should be a space before the opening brace in function definitions.
| const StepData_Factors& theLocalFactors){ | |
| const StepData_Factors& theLocalFactors) { |
| const Handle(Geom_BSplineCurve)& BS, | ||
| const StepData_Factors& theLocalFactors) | ||
| { | ||
| const StepData_Factors& theLocalFactors){ |
There was a problem hiding this comment.
Missing space before opening brace. According to OCCT style conventions, there should be a space before the opening brace in function definitions.
| const StepData_Factors& theLocalFactors){ | |
| const StepData_Factors& theLocalFactors) { |
…pty lines after Standard_DEPRECATED
- Adjusted access specifiers and formatting in multiple header files, including DrawTrSurf_Curve2d.hxx, DrawTrSurf_Point.hxx, DrawTrSurf_Polygon2D.hxx, DrawTrSurf_Polygon3D.hxx, DrawTrSurf_Surface.hxx, DrawTrSurf_Triangulation.hxx, and HLRTest_Projector.hxx. - Simplified method definitions by removing unnecessary line breaks and ensuring consistent spacing around operators. - Updated deprecated TCollection class to use NCollection_Primes for prime number generation. - Enhanced clarity in comments and code structure across various files in the ModelingData and Visualization directories.
- Marked several methods as deprecated in the following files: - XCAFDoc_VisMaterial.hxx - Poly_PolygonOnTriangulation.hxx - Poly_Triangulation.hxx - NCollection_Map.hxx - Standard_Atomic.hxx - Standard_Handle.hxx - ShapeAnalysis_ShapeContents.hxx - OpenGl_Context.hxx - OpenGl_FrameBuffer.hxx - OpenGl_Texture.hxx - Font_FTFont.hxx - Font_TextFormatter.hxx - Graphic3d_AspectFillArea3d.hxx - Graphic3d_Aspects.hxx - Graphic3d_MaterialAspect.hxx - Graphic3d_Structure.hxx - AIS_InteractiveContext.hxx - Prs3d_Drawer.hxx - PrsMgr_Presentation.hxx - Select3D_SensitiveCircle.hxx - SelectBasics_SelectingVolumeManager.hxx - SelectMgr_EntityOwner.hxx - V3d_View.hxx - V3d_Viewer.hxx - Updated comments to indicate alternative methods to use instead.
3f01bbc to
88585b2
Compare
No description provided.