pointfreeco / swift-composable-architecture

A library for building applications in a consistent and understandable way, with composition, testing, and ergonomics in mind.
https://www.pointfree.co/collections/composable-architecture
MIT License
11.92k stars 1.37k forks source link

Add `.editorconfig` for consistent code formatting #3215

Closed Matejkob closed 1 week ago

Matejkob commented 2 weeks ago

Xcode 16 added support for the EditorConfig standard[^1]. This allows a project/repo to specify basic formatting rules so the editor can behave correctly.[^2]

[!NOTE] You may need to quit and relaunch Xcode for it to pick up the .editorconfig file after switching to a branch where it's present.[^3]

The added .editorconfig file contains:

# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true

These settings apply to all files in the project ([*]).

This change make much easier the process of switch between projects that use 2-space and 4-space indentation (what is quite common in your community).

[^1]: Xcode 16 Beta 2 Release Notes–Source Editor New Features [^2]: Inspired by: Add an EditorConfig file [^3]: Xcode 16 Beta 2 Release Notes–Source Editor Known Issues