[SERVER-46620] clang_format.py allows mixed indentation Created: 04/Mar/20  Updated: 27/Oct/23  Resolved: 21/May/20

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Marcos José Grillo Ramirez Assignee: Robert Guo (Inactive)
Resolution: Works as Designed Votes: 0
Labels: clang-format
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Steps To Reproduce:
  • Change a correct 4 space indentation for a tab on a jstest
  • Run buildscripts/clang_format.py format
  • Check that the wrong indentation was not changed.
Participants:

 Description   

Before submitting any code to the commit queue, it is recommended to run the clang format utility, however, a tab indentation was not replaced on a jstest file, even though a configuration parameter is set on the .clang-format file:

https://github.com/mongodb/mongo/blob/1ff7ccd082d3290d13b1b540f97bdc1e33f29ad6/.clang-format#L232



 Comments   
Comment by Robert Guo (Inactive) [ 21/May/20 ]

(python3-venv) ➜  mongo git: ✗ git --no-pager -c core.whitespace=tab-in-indent diff --check
jstests/core/all2.js:12: tab in indent.
+	assert.eq(n, t.find(q).count(), tojson(q) + " " + e + " count " + state);
(python3-venv) ➜  mongo git: ✗ python buildscripts/clang_format.py format
(python3-venv) ➜  mongo git: git --no-pager -c core.whitespace=tab-in-indent diff --check

I was not able to repro the problem locally on a recent version of the mongo repo. Please try it again on a newly checked out mongo repo and paste all the input and output from your terminal if you're still seeing this problem.

Generated at Thu Feb 08 05:11:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.