FasterTransformer icon indicating copy to clipboard operation
FasterTransformer copied to clipboard

PR/commits full of formatting changes - hard to parse the actual code change - codebase not formatted as .clang-format

Open chenho74 opened this issue 2 years ago • 1 comments

Branch/Tag/Commit

main

Docker Image Version

n/a

GPU name

n/a

CUDA Driver

n/a

Reproduced Steps

For example, this commit https://github.com/NVIDIA/FasterTransformer/commit/b41451e6225b0a80bb9a6924660b1485407fe7ad consists of many line changes that are purely reformatting(e.g. src/fastertransformer/kernels/add_residual_kernels.cu). It takes much longer than necessary to read and understand changes in the commit.

After some investigation, I also found that running formatting according to .clang-format produces updates on files. For example, https://github.com/NVIDIA/FasterTransformer/blob/b41451e6225b0a80bb9a6924660b1485407fe7ad/3rdparty/INIReader.h#L26 will become typedef int (*ini_handler)(void* user, const char* section, const char* name, const char* value); with no line breaks. This seems to show that the repo was not formatted before every commit to main.

In the future, the formatting changes in commits can be avoided by running the repo through a consistent formatter before every commit. Are there any ways we can quickly fix this and narrow down the code changes in the commits as a short-term solution?

chenho74 avatar Oct 07 '22 14:10 chenho74

Thank you for the suggestion. Sometime, we will update the clang file and then need to update format of many codes. We will prevent ignoring updating some files in the future.

I don't have solution for short-term.

byshiue avatar Oct 10 '22 01:10 byshiue