Project

General

Profile

Improvements #10248

Bite the bullet and purge tabs from Wt source code

Added by Roel Standaert 7 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
04/26/2022
Due date:
% Done:

100%

Estimated time:

Description

At the moment we have a rather inconsistent indentation style: newer code uses 2 spaces per indentation level, no tabs, and older code uses 2 spaces per indentation level, and turning 8 spaces into a tab (this is what Emacs does by default).

If your editor is set correctly to 8 spaces per tab then the code will look fine, but some users will have their editor set incorrectly, and see a mess.

We'll have to bite the bullet and finally replace all tabs with spaces.

This will mess with the git history, but we can:

  • Hide whitespace changes in GitLab and GitHub with a click of a button
  • Use git blame -w if we want to ignore whitespace changes when blaming
#1

Updated by Roel Standaert 7 months ago

  • Status changed from InProgress to Resolved
  • % Done changed from 0 to 100
#2

Updated by Christian Meyer 6 months ago

Hey, just a comment, but should this problem not be easily achived by using a linter?
Might be a little longer to set up but should enable consistency for the future

#3

Updated by Roel Standaert 6 months ago

The issue was really with older code that still needed to be updated, all of the new code was already fine. I didn't go so far as to actually use something like a formatter, but we've had an .editorconfig file for a while so that IDEs or editors that support it automatically adjust their settings.

If you are referring to the actual converting of tabs to spaces: that was easily fixed with some find and sed.

#4

Updated by Roel Standaert 5 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF