Skip to content

Conversation

@Frizlab
Copy link
Contributor

@Frizlab Frizlab commented Sep 6, 2025

I use (the superior) tab indentation in Xcode, but this project uses spaces for indentation.
Having a .editorconfig file at the root of the project makes Xcode automatically apply the correct config for this project.

(PS: I’m trolling regarding the tabs vs. spaces subject as it is a common flame war, but I’m not serious about it! Except that tabs are indeed objectively better, for accessibility.)

@Frizlab Frizlab requested a review from mattesmohr as a code owner September 6, 2025 22:16
@mattesmohr
Copy link
Member

I have no opinion on that matter, to be honest. As far I can tell, if other packages have a editorconfig set up, it uses spaces instead of tabs. But, I don't know actually.

At least I would like to understand the topic/file a bit more, before we add this to the package.

@Frizlab
Copy link
Contributor Author

Frizlab commented Sep 8, 2025

Xcode 16 added support for the .editorconfig file.

The file allows customizing supporting editors (I’m 99% certain VSCode supports it, and a lot of other editors do too) wrt the indentation choices. The indentation settings chosen by the user are overridden for the project by the values in the .editorconfig file.
This allows working on different projects with different coding-styles without having to change the editor settings all the time.

In your case, currently indent is 4 spaces, which is represented with the indent_style = space, indent_size = 4 and tab_width = 4 lines in the .editorconfig file I propose.

Traditionally in Xcode the settings were part of the xcodeproj directly, but with SPM we’re getting rid of the xcodeproj, so Apple added support for the .editorconfig file in Xcode.

Copy link
Member

@mattesmohr mattesmohr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with the file. Just some question out of curiosity. The last two settings I beg to differ.

@mattesmohr mattesmohr merged commit 98db057 into vapor-community:main Sep 9, 2025
1 check passed
@Frizlab Frizlab deleted the tech/frizlab/editorconfig branch September 9, 2025 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants