SlideShare uma empresa Scribd logo
1 de 11
Baixar para ler offline
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

Mais conteúdo relacionado

Semelhante a Tailor - Linter for Swift

Productivity Enhencement with Visual Studio
Productivity Enhencement with Visual StudioProductivity Enhencement with Visual Studio
Productivity Enhencement with Visual Studio
Ahasan Habib
 

Semelhante a 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
 

Mais de Henrique Morbin

Mais de 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
 

Último

Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Cara Menggugurkan Kandungan 087776558899
 

Último (8)

Android Application Components with Implementation & Examples
Android Application Components with Implementation & ExamplesAndroid Application Components with Implementation & Examples
Android Application Components with Implementation & Examples
 
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
 
Mobile Application Development-Components and Layouts
Mobile Application Development-Components and LayoutsMobile Application Development-Components and Layouts
Mobile Application Development-Components and Layouts
 
Leading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdfLeading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdf
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
 
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
 
Mobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s ToolsMobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s Tools
 
Thane 💋 Call Girls 7738631006 💋 Call Girls in Thane Escort service book now. ...
Thane 💋 Call Girls 7738631006 💋 Call Girls in Thane Escort service book now. ...Thane 💋 Call Girls 7738631006 💋 Call Girls in Thane Escort service book now. ...
Thane 💋 Call Girls 7738631006 💋 Call Girls in Thane Escort service book now. ...
 

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