SlideShare a Scribd company logo
Tailor
Linter for Swift
What it is?
Tailor is a cross-platform static
analysis and lint tool for source code
written in Apple's Swift programming
language. It analyzes your code to
ensure consistent styling and help
avoid bugs.
Cross-plataform
● Windows (10+)
● Mac OS X (10.10+)
● Linux
Example
> tailor SettingsViewController.swift
● default (no options)
Example
> tailor --except=trailing-whitespace --
max-severity error
SettingsViewController.swift
● ignoring white spaces
● change severity to error
Rules
●[upper-camel-case] UpperCamelCase naming
●[lower-camel-case] lowerCamelCase naming
●[constant-naming] Constant naming
●[constant-k-prefix] Flag "k-prefixed" constants
●[arrow-whitespace] Flag arrows that are not space delimited
●[angle-bracket-whitespace] Check whitespace in and around angular brackets
●[colon-whitespace] Flag incorrect whitespace around colons
●[comma-whitespace] Flag commas that are not left associated
●[operator-whitespace] Flag operators that are not space delimited (only in operator declarations)
●[leading-whitespace] Flag leading whitespace in a file
●[parentheses-whitespace] Check whitespace in and around parenthesis
●[terminating-newline] Single newline at end of source file
●[trailing-whitespace] Flag trailing whitespace
●[comment-whitespace] Comment whitespace checks
●[function-whitespace] Blank lines around functions
Naming Whitespace
Rules
●Restrict number of lines per file and construct body
○[max-class-length]
○[max-closure-length]
○[max-file-length]
○[max-function-length]
○[max-struct-length]
●Restrict number of characters per line and construct name
○[max-line-length]
○[max-name-length]
○[min-name-length]
●[redundant-parentheses] Flag redundant parentheses
●[brace-style] One true brace style
●[forced-type-cast] Flag force casts
●[multiple-imports] One import per line
●[terminating-semicolon] Flag semicolon terminated statements
●[todo-syntax] Verify TODO syntax
●[redundant-optional-binding] Flag redundant let/var bindings in optional binding lists
●[trailing-closure] Closures that are the last argument of a function should be passed using 'trailing closure' syntax.
Length Others
Xcode Integration
● Run a command in Terminal
● Result in Xcode
Xcode Integration
● Build time
Fastlane + Tailor
Thank you!
Henrique Morbin
henrique.morbin@ilegra.com
github.com/Morbix

More Related Content

Similar to Tailor - Linter for Swift

C tour Unix
C tour UnixC tour Unix
C tour Unix
Melvin Cabatuan
 
不深不淺,帶你認識 LLVM (Found LLVM in your life)
不深不淺,帶你認識 LLVM (Found LLVM in your life)不深不淺,帶你認識 LLVM (Found LLVM in your life)
不深不淺,帶你認識 LLVM (Found LLVM in your life)
Douglas Chen
 
Linux fundamental - Chap 00 shell
Linux fundamental - Chap 00 shellLinux fundamental - Chap 00 shell
Linux fundamental - Chap 00 shell
Kenny (netman)
 
Angular - Chapter 2 - TypeScript Programming
Angular - Chapter 2 - TypeScript Programming  Angular - Chapter 2 - TypeScript Programming
Angular - Chapter 2 - TypeScript Programming
WebStackAcademy
 
Krolnik ak metro_dv_nov
Krolnik ak metro_dv_novKrolnik ak metro_dv_nov
Krolnik ak metro_dv_nov
Obsidian Software
 
07 140430-ipp-languages used in llvm during compilation
07 140430-ipp-languages used in llvm during compilation07 140430-ipp-languages used in llvm during compilation
07 140430-ipp-languages used in llvm during compilation
Adam Husár
 
002. Introducere in type script
002. Introducere in type script002. Introducere in type script
002. Introducere in type script
Dmitrii Stoian
 
What's coming to c# (Tel-Aviv, 2018)
What's coming to c# (Tel-Aviv, 2018)What's coming to c# (Tel-Aviv, 2018)
What's coming to c# (Tel-Aviv, 2018)
Moaid Hathot
 
Start with swift
Start with swiftStart with swift
Introduction to c++.pdf
Introduction to c++.pdfIntroduction to c++.pdf
Introduction to c++.pdf
bcs2022030
 
Improving Code Quality Through Effective Review Process
Improving Code Quality Through Effective  Review ProcessImproving Code Quality Through Effective  Review Process
Improving Code Quality Through Effective Review Process
Dr. Syed Hassan Amin
 
Productivity Enhencement with Visual Studio
Productivity Enhencement with Visual StudioProductivity Enhencement with Visual Studio
Productivity Enhencement with Visual Studio
Ahasan Habib
 
Nakov dot net-framework-overview-english
Nakov dot net-framework-overview-englishNakov dot net-framework-overview-english
Nakov dot net-framework-overview-english
srivathsan.10
 
Client side scripting
Client side scriptingClient side scripting
Client side scripting
Eleonora Ciceri
 
270_1_CIntro_Up_To_Functions.ppt
270_1_CIntro_Up_To_Functions.ppt270_1_CIntro_Up_To_Functions.ppt
270_1_CIntro_Up_To_Functions.ppt
JoshCasas1
 
C++ programming language basic to advance level
C++ programming language basic to advance levelC++ programming language basic to advance level
C++ programming language basic to advance level
sajjad ali khan
 
Modern Programming Languages - An overview
Modern Programming Languages - An overviewModern Programming Languages - An overview
Modern Programming Languages - An overview
Ayman Mahfouz
 
Become Jythonic in FDMEE (KSCOPE15)
Become Jythonic in FDMEE (KSCOPE15)Become Jythonic in FDMEE (KSCOPE15)
Become Jythonic in FDMEE (KSCOPE15)
Francisco Amores
 
Dart workshop
Dart workshopDart workshop
Dart workshop
Vishnu Suresh
 
Feature and platform testing with CMake
Feature and platform testing with CMakeFeature and platform testing with CMake
Feature and platform testing with CMake
Richard Thomson
 

Similar to Tailor - Linter for Swift (20)

C tour Unix
C tour UnixC tour Unix
C tour Unix
 
不深不淺,帶你認識 LLVM (Found LLVM in your life)
不深不淺,帶你認識 LLVM (Found LLVM in your life)不深不淺,帶你認識 LLVM (Found LLVM in your life)
不深不淺,帶你認識 LLVM (Found LLVM in your life)
 
Linux fundamental - Chap 00 shell
Linux fundamental - Chap 00 shellLinux fundamental - Chap 00 shell
Linux fundamental - Chap 00 shell
 
Angular - Chapter 2 - TypeScript Programming
Angular - Chapter 2 - TypeScript Programming  Angular - Chapter 2 - TypeScript Programming
Angular - Chapter 2 - TypeScript Programming
 
Krolnik ak metro_dv_nov
Krolnik ak metro_dv_novKrolnik ak metro_dv_nov
Krolnik ak metro_dv_nov
 
07 140430-ipp-languages used in llvm during compilation
07 140430-ipp-languages used in llvm during compilation07 140430-ipp-languages used in llvm during compilation
07 140430-ipp-languages used in llvm during compilation
 
002. Introducere in type script
002. Introducere in type script002. Introducere in type script
002. Introducere in type script
 
What's coming to c# (Tel-Aviv, 2018)
What's coming to c# (Tel-Aviv, 2018)What's coming to c# (Tel-Aviv, 2018)
What's coming to c# (Tel-Aviv, 2018)
 
Start with swift
Start with swiftStart with swift
Start with swift
 
Introduction to c++.pdf
Introduction to c++.pdfIntroduction to c++.pdf
Introduction to c++.pdf
 
Improving Code Quality Through Effective Review Process
Improving Code Quality Through Effective  Review ProcessImproving Code Quality Through Effective  Review Process
Improving Code Quality Through Effective Review Process
 
Productivity Enhencement with Visual Studio
Productivity Enhencement with Visual StudioProductivity Enhencement with Visual Studio
Productivity Enhencement with Visual Studio
 
Nakov dot net-framework-overview-english
Nakov dot net-framework-overview-englishNakov dot net-framework-overview-english
Nakov dot net-framework-overview-english
 
Client side scripting
Client side scriptingClient side scripting
Client side scripting
 
270_1_CIntro_Up_To_Functions.ppt
270_1_CIntro_Up_To_Functions.ppt270_1_CIntro_Up_To_Functions.ppt
270_1_CIntro_Up_To_Functions.ppt
 
C++ programming language basic to advance level
C++ programming language basic to advance levelC++ programming language basic to advance level
C++ programming language basic to advance level
 
Modern Programming Languages - An overview
Modern Programming Languages - An overviewModern Programming Languages - An overview
Modern Programming Languages - An overview
 
Become Jythonic in FDMEE (KSCOPE15)
Become Jythonic in FDMEE (KSCOPE15)Become Jythonic in FDMEE (KSCOPE15)
Become Jythonic in FDMEE (KSCOPE15)
 
Dart workshop
Dart workshopDart workshop
Dart workshop
 
Feature and platform testing with CMake
Feature and platform testing with CMakeFeature and platform testing with CMake
Feature and platform testing with CMake
 

More from Henrique Morbin

Swift Access Control
Swift Access ControlSwift Access Control
Swift Access Control
Henrique Morbin
 
Contratos Fortes com Programação Funcional
Contratos Fortes com Programação FuncionalContratos Fortes com Programação Funcional
Contratos Fortes com Programação Funcional
Henrique Morbin
 
Você já testou os seus testes?
Você já testou os seus testes?Você já testou os seus testes?
Você já testou os seus testes?
Henrique Morbin
 
Understanding stack views
Understanding stack viewsUnderstanding stack views
Understanding stack views
Henrique Morbin
 
Understanding Auto Layout
Understanding Auto LayoutUnderstanding Auto Layout
Understanding Auto Layout
Henrique Morbin
 
7 perguntas para mudar a forma como você faz coaching
7 perguntas para mudar a forma como você faz coaching7 perguntas para mudar a forma como você faz coaching
7 perguntas para mudar a forma como você faz coaching
Henrique Morbin
 
Bond, swift bond
Bond, swift bondBond, swift bond
Bond, swift bond
Henrique Morbin
 
Fastlane
FastlaneFastlane
Fastlane
Henrique Morbin
 
Hackathon Queen Mob - Tools and Helpers
Hackathon Queen Mob - Tools and HelpersHackathon Queen Mob - Tools and Helpers
Hackathon Queen Mob - Tools and Helpers
Henrique Morbin
 
Parse - Backend As A Service
Parse - Backend As A ServiceParse - Backend As A Service
Parse - Backend As A Service
Henrique Morbin
 
Cocoa Touch Framework 8
Cocoa Touch Framework 8Cocoa Touch Framework 8
Cocoa Touch Framework 8
Henrique Morbin
 
Introdução ao Swift por Henrique Morbin – iOS Developer
Introdução ao Swift por Henrique Morbin – iOS DeveloperIntrodução ao Swift por Henrique Morbin – iOS Developer
Introdução ao Swift por Henrique Morbin – iOS Developer
Henrique Morbin
 

More from Henrique Morbin (12)

Swift Access Control
Swift Access ControlSwift Access Control
Swift Access Control
 
Contratos Fortes com Programação Funcional
Contratos Fortes com Programação FuncionalContratos Fortes com Programação Funcional
Contratos Fortes com Programação Funcional
 
Você já testou os seus testes?
Você já testou os seus testes?Você já testou os seus testes?
Você já testou os seus testes?
 
Understanding stack views
Understanding stack viewsUnderstanding stack views
Understanding stack views
 
Understanding Auto Layout
Understanding Auto LayoutUnderstanding Auto Layout
Understanding Auto Layout
 
7 perguntas para mudar a forma como você faz coaching
7 perguntas para mudar a forma como você faz coaching7 perguntas para mudar a forma como você faz coaching
7 perguntas para mudar a forma como você faz coaching
 
Bond, swift bond
Bond, swift bondBond, swift bond
Bond, swift bond
 
Fastlane
FastlaneFastlane
Fastlane
 
Hackathon Queen Mob - Tools and Helpers
Hackathon Queen Mob - Tools and HelpersHackathon Queen Mob - Tools and Helpers
Hackathon Queen Mob - Tools and Helpers
 
Parse - Backend As A Service
Parse - Backend As A ServiceParse - Backend As A Service
Parse - Backend As A Service
 
Cocoa Touch Framework 8
Cocoa Touch Framework 8Cocoa Touch Framework 8
Cocoa Touch Framework 8
 
Introdução ao Swift por Henrique Morbin – iOS Developer
Introdução ao Swift por Henrique Morbin – iOS DeveloperIntrodução ao Swift por Henrique Morbin – iOS Developer
Introdução ao Swift por Henrique Morbin – iOS Developer
 

Tailor - Linter for Swift

  • 2. What it is? Tailor is a cross-platform static analysis and lint tool for source code written in Apple's Swift programming language. It analyzes your code to ensure consistent styling and help avoid bugs.
  • 3. Cross-plataform ● Windows (10+) ● Mac OS X (10.10+) ● Linux
  • 5. Example > tailor --except=trailing-whitespace -- max-severity error SettingsViewController.swift ● ignoring white spaces ● change severity to error
  • 6. Rules ●[upper-camel-case] UpperCamelCase naming ●[lower-camel-case] lowerCamelCase naming ●[constant-naming] Constant naming ●[constant-k-prefix] Flag "k-prefixed" constants ●[arrow-whitespace] Flag arrows that are not space delimited ●[angle-bracket-whitespace] Check whitespace in and around angular brackets ●[colon-whitespace] Flag incorrect whitespace around colons ●[comma-whitespace] Flag commas that are not left associated ●[operator-whitespace] Flag operators that are not space delimited (only in operator declarations) ●[leading-whitespace] Flag leading whitespace in a file ●[parentheses-whitespace] Check whitespace in and around parenthesis ●[terminating-newline] Single newline at end of source file ●[trailing-whitespace] Flag trailing whitespace ●[comment-whitespace] Comment whitespace checks ●[function-whitespace] Blank lines around functions Naming Whitespace
  • 7. Rules ●Restrict number of lines per file and construct body ○[max-class-length] ○[max-closure-length] ○[max-file-length] ○[max-function-length] ○[max-struct-length] ●Restrict number of characters per line and construct name ○[max-line-length] ○[max-name-length] ○[min-name-length] ●[redundant-parentheses] Flag redundant parentheses ●[brace-style] One true brace style ●[forced-type-cast] Flag force casts ●[multiple-imports] One import per line ●[terminating-semicolon] Flag semicolon terminated statements ●[todo-syntax] Verify TODO syntax ●[redundant-optional-binding] Flag redundant let/var bindings in optional binding lists ●[trailing-closure] Closures that are the last argument of a function should be passed using 'trailing closure' syntax. Length Others
  • 8. Xcode Integration ● Run a command in Terminal ● Result in Xcode