inference icon indicating copy to clipboard operation
inference copied to clipboard

Proposal: run clang-format and autopep8 on the existing code base; potentially add pre-commit hook for code style checking

Open nvzhihanj opened this issue 2 years ago • 3 comments

The current C++ code base follows C and fortran coding style, which is a bit stale given that C++14 is used. We would like to clang-format all the C++ code base and run autopep8 on all the python code base to adapt to the latest industry standards and modern C++ coding.

This can be done in v4.1. @pgmpablo157321 FYI. I can help if needed.

nvzhihanj avatar Feb 06 '24 19:02 nvzhihanj

As mentioned by Pablo, pre-commit hook is not necessarily installed by the developer. Automatically apply the format change in the PR automation is more reasonable. Note: if automatic reformat is enabled, clang-format config needs to include SortIncludes: false so the functionality of the original code is not affected.

nvzhihanj avatar Apr 02 '24 16:04 nvzhihanj

@pgmpablo157321 to handle

mrmhodak avatar Apr 02 '24 16:04 mrmhodak

clang-format has many style options and even predefined options (LLVM, Google, Chromium, Mozilla, WebKit, Microsoft). Any thoughts on which one we should adopt?

As a recycled compiler person :), I'd vote for LLVM ;).

psyhtest avatar Apr 02 '24 16:04 psyhtest

Closing this issue.

nvzhihanj avatar Jul 08 '24 22:07 nvzhihanj