Skip to content

Coding - Update Clang-format with more macroses#677

Merged
dpasukhi merged 3 commits into
Open-Cascade-SAS:IRfrom
dpasukhi:formatting-update
Aug 16, 2025
Merged

Coding - Update Clang-format with more macroses#677
dpasukhi merged 3 commits into
Open-Cascade-SAS:IRfrom
dpasukhi:formatting-update

Conversation

@dpasukhi
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-format to include OCC_CATCH_SIGNALS, DEFINE_STANDARD_RTTIEXT, and Draw_Drawable3D_FACTORY as statement macros
  • Adds a GitHub action step to automatically remove empty lines after Standard_DEPRECATED macro 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){
Copy link

Copilot AI Aug 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space before opening brace. According to OCCT style conventions, there should be a space before the opening brace in function definitions.

Suggested change
GeomToStep_MakeLine::GeomToStep_MakeLine(const gp_Lin& L, const StepData_Factors& theLocalFactors){
GeomToStep_MakeLine::GeomToStep_MakeLine(const gp_Lin& L, const StepData_Factors& theLocalFactors) {

Copilot uses AI. Check for mistakes.
GeomToStep_MakeLine::GeomToStep_MakeLine(const gp_Lin2d& L, const StepData_Factors& theLocalFactors)
{
GeomToStep_MakeLine::GeomToStep_MakeLine(const gp_Lin2d& L,
const StepData_Factors& theLocalFactors){
Copy link

Copilot AI Aug 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space before opening brace. According to OCCT style conventions, there should be a space before the opening brace in function definitions.

Suggested change
const StepData_Factors& theLocalFactors){
const StepData_Factors& theLocalFactors) {

Copilot uses AI. Check for mistakes.
const Handle(Geom_BSplineCurve)& BS,
const StepData_Factors& theLocalFactors)
{
const StepData_Factors& theLocalFactors){
Copy link

Copilot AI Aug 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space before opening brace. According to OCCT style conventions, there should be a space before the opening brace in function definitions.

Suggested change
const StepData_Factors& theLocalFactors){
const StepData_Factors& theLocalFactors) {

Copilot uses AI. Check for mistakes.
const Handle(Geom_BSplineCurve)& BS,
const StepData_Factors& theLocalFactors)
{
const StepData_Factors& theLocalFactors){
Copy link

Copilot AI Aug 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space before opening brace. According to OCCT style conventions, there should be a space before the opening brace in function definitions.

Suggested change
const StepData_Factors& theLocalFactors){
const StepData_Factors& theLocalFactors) {

Copilot uses AI. Check for mistakes.
- 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.
@dpasukhi dpasukhi merged commit 314527f into Open-Cascade-SAS:IR Aug 16, 2025
23 checks passed
@dpasukhi dpasukhi deleted the formatting-update branch August 16, 2025 19:50
@github-project-automation github-project-automation Bot moved this from Todo to Done in Maintenance Aug 16, 2025
@dpasukhi dpasukhi added this to the Release 8.0 milestone Aug 16, 2025
@dpasukhi dpasukhi added 2. Enhancement New feature or request 1. Coding Coding rules, trivial changes and misprints labels Aug 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1. Coding Coding rules, trivial changes and misprints 2. Enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants