The International Simutrans Forum

 

Author Topic: [patch] Editorconfig  (Read 296 times)

0 Members and 1 Guest are viewing this topic.

Offline ceeac

  • *
  • Posts: 11
[patch] Editorconfig
« on: December 02, 2018, 07:56:43 PM »
This patch adds a simple .editorconfig file to tell text editors to use consistent spacing by default (if the editor supports Editorconfig).
This should prevent mixed tabs and spaces for developers who use spaces for indentation (like myself).

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9313
  • Languages: De,EN,JP
Re: [patch] Editorconfig
« Reply #1 on: December 03, 2018, 05:29:25 AM »
Thank you, I was not aware of that convention. But I am not sure if any developer here could profit from it.

And we never ever formally agree on a spacing at all. Although 4 is fine with me.

If one uses this, one should also enable trimming of whitespaces in all dat,cc,c,h and Makefiles (but not in txt and tab)

At least for MSVC I found these entries:
Code: [Select]
insert_final_newline
trim_trailing_whitespace

Offline ceeac

  • *
  • Posts: 11
Re: [patch] Editorconfig
« Reply #2 on: December 03, 2018, 07:11:52 AM »
Updated patch:
  • Removed indent_size=4 to use the editor default value (except Makefile, .mk, .rc, .nsi and .nsh since those have clearly different indentation styles
  • Enabled trimming trailing whitespace for all files except .txt and .tab

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9313
  • Languages: De,EN,JP
Re: [patch] Editorconfig
« Reply #3 on: December 03, 2018, 11:32:55 AM »
I was not against 4, but I think we just never talked about.

Anyway, I will include it, even though I cannot test it (MSVC 2012 is too old).