Project

General

Profile

Idea #20508

Manage committing whitespace changes

Added by Eric Flumerfelt about 1 year ago. Updated about 1 year ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
-
Target version:
-
Start date:
08/01/2018
Due date:
% Done:

0%

Estimated time:
Experiment:
-
Duration:

Description

We should try and avoid commits which have formatting changes alongside actual code changes. There are a couple ways of doing this, such as using clang-format on a regular basis or somehow instructing Git to ignore all whitespace changes (or using a pre-commit hook to avoid them).

.clang-format (2.54 KB) .clang-format .clang-format from Gennadiy (In-use in artdaq_database) Eric Flumerfelt, 09/07/2018 11:52 AM
.clang-format (2.76 KB) .clang-format .clang-format from Eric (Similar to formatting used elsewhere in artdaq) Eric Flumerfelt, 09/07/2018 11:52 AM

History

#1 Updated by Kyle Knoepfel about 1 year ago

Eric, the title of this issue states a possible solution to an unstated problem. I argue that making whitespace-only changes is perfectly reasonable as long as they are not conflated with more substantive changes. A better title would be something like "develop a protocol for making clean commits", where the description can then list possible solutions (e.g.):

  • Formatting-only changes should have separate commits from those with substantive ones
  • Pursue feasibility of instituting common source-code formatting
  • etc.

#2 Updated by Eric Flumerfelt about 1 year ago

  • Subject changed from Avoid committing whitespace changes to Manage committing whitespace changes

#3 Updated by Eric Flumerfelt about 1 year ago

I'm attaching two different .clang-format files. If we can agree on a standard .clang-format file to use for all repositories, we can then run clang-format at regular intervals and commit the resulting white-space changes.



Also available in: Atom PDF