From d11082316ab797a0992282188a251a6614aa735b Mon Sep 17 00:00:00 2001 From: Ivan Smolin Date: Wed, 3 May 2017 11:02:54 +0300 Subject: [PATCH] add Tailor and SwiftLint configs --- .swiftlint.yml | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++ .tailor.yml | 3 ++ 2 files changed, 99 insertions(+) create mode 100644 .swiftlint.yml create mode 100644 .tailor.yml diff --git a/.swiftlint.yml b/.swiftlint.yml new file mode 100644 index 0000000..d5c9f72 --- /dev/null +++ b/.swiftlint.yml @@ -0,0 +1,96 @@ +disabled_rules: + - variable_name +excluded: + - Carthage + - Pods +line_length: 128 +type_body_length: + - 500 # warning + - 700 # error +file_length: + warning: 500 + error: 1200 +warning_threshold: 1 + +custom_rules: + uiwebview_disabled: + included: ".*.swift" + name: "UIWebView Usage Disabled" + regex: 'UIWebView' + message: "Do not use UIWebView. Use WKWebView Instead. https://developer.apple.com/reference/uikit/uiwebview" + severity: error + + native_print: + name: "print -> DDLog" + regex: '(print|NSLog)\(' + message: "Please use CocoaLumberjack instead `print` and `NSlog`" + severity: error + + zero: + name: "Short .zero" + regex: '\(top: 0, left: 0, bottom: 0, right: 0\)' + message: "Please use short init `.zero`." + severity: error + + private_variable: + name: "Private variable" + regex: '(?|>=)\s*0' + message: "Prefer checking `isEmpty` over comparing `count` to zero." + severity: warning + + # Should be { braces_body } instead of {braces_body} + spaces_around_braces: + included: ".*.swift" + name: "Spaces around the braces" + regex: '(([A-Za-z0-9])[\{\}])|([\{\}]([A-Za-z0-9]))' + message: "No spaces around the braces" + severity: error diff --git a/.tailor.yml b/.tailor.yml new file mode 100644 index 0000000..4fe3d42 --- /dev/null +++ b/.tailor.yml @@ -0,0 +1,3 @@ +exclude: + - 'Pods' + - 'Carthage'