Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Config for SwiftFormat compliant with Google Swift Guideline

NotificationsYou must be signed in to change notification settings

NoemiRozpara/Google-SwiftFormat-Config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

SwiftFormat config compliant with Google Swift Guideline

What

This repository contains ready-to-use.swiftformat config, which helps to keep swift code style compliant with Google Swift Guideline.

Why

Setting a formatter with code style rules has many advantages:

  • Keeping code clean and readable ✨
  • Similar-looking code no matter which team member developed it 📘 📗 📙
  • Not wasting time on manual code formatting, meaningless code reviews ("break this line, please") or arguing over the rules ⌛

I couldn't find any ready-to-use public template I could just copy and paste into new project, instead of thinking about it every time 🤷

There are few popular Swift style guidelines. I decided to pick Google's one, as it has hard line-length constraint (from the experience, lack of this constraint led to unreasonably long lines in code):Read the guideline

How to use

  1. Integrate SwiftFormat into your project:SwiftFormat repository
  2. Download.swiftformat file and put it in your project root

Additional notes

The file contains mandatory rules (explicitly set in the guidelines), as well as additional rules (those not being specified in the guideline, but helping to keep the codebase clean and minimize redundant code).

Because of the limited formatter abilites, some rules were not implemented 1:1 accordingly to the guideline (e.g.@modifiers are always on the separate line, even though the guideline allows to keep them inline of they don't have any arguments).

The guideline covers much more than formatter rules - naming convention, code structure and others. I strongly encourage you to read it and keep it in mind during the development 🧠

If you spot some rule being against the guideline, or you have any other concerns, please let me know 🌻

About

Config for SwiftFormat compliant with Google Swift Guideline

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp