Skip to content

Commit

Permalink
Add lint
Browse files Browse the repository at this point in the history
  • Loading branch information
eonist committed May 7, 2019
1 parent 3b7491e commit de390eb
Show file tree
Hide file tree
Showing 9 changed files with 324 additions and 48 deletions.
156 changes: 156 additions & 0 deletions .swiftlint.yml
@@ -0,0 +1,156 @@
whitelist_rules:
- anyobject_protocol
- array_init
#- attributes
- block_based_kvo
- class_delegate_protocol
- closing_brace
- closure_end_indentation
- closure_parameter_position
- closure_spacing
- collection_alignment
- colon
- comma
- compiler_protocol_init
# - conditional_returns_on_newline
- contains_over_first_not_nil
- control_statement
- deployment_target
- discarded_notification_center_observer
- discouraged_direct_init
- discouraged_object_literal
- discouraged_optional_boolean
# - discouraged_optional_collection
- duplicate_imports
- dynamic_inline
- empty_count
- empty_enum_arguments
- empty_parameters
- empty_parentheses_with_trailing_closure
- empty_string
- empty_xctest_method
- explicit_init
- fallthrough
- fatal_error_message
- first_where
- for_where
- generic_type_name
- identical_operands
- identifier_name
- implicit_getter
- implicit_return
- inert_defer
- is_disjoint
- joined_default_parameter
- last_where
- leading_whitespace
- legacy_cggeometry_functions
- legacy_constant
- legacy_constructor
- legacy_hashing
- legacy_nsgeometry_functions
- legacy_random
- literal_expression_end_indentation
- lower_acl_than_parent
- mark
- modifier_order
- multiline_arguments
- multiline_function_chains
- multiline_literal_brackets
- multiline_parameters
- multiline_parameters_brackets
- multiple_closures_with_trailing_closure
- nimble_operator
- no_extension_access_modifier
- no_fallthrough_only
- notification_center_detachment
- number_separator
- object_literal
- opening_brace
- operator_usage_whitespace
- operator_whitespace
- overridden_super_call
- pattern_matching_keywords
- private_action
# - private_outlet
- private_unit_test
- prohibited_super_call
- protocol_property_accessors_order
- redundant_discardable_let
- redundant_nil_coalescing
- redundant_objc_attribute
- redundant_optional_initialization
- redundant_set_access_control
- redundant_string_enum_value
- redundant_type_annotation
- redundant_void_return
- required_enum_case
- return_arrow_whitespace
- shorthand_operator
- sorted_first_last
# - statement_position
- static_operator
# - strong_iboutlet
- superfluous_disable_command
- switch_case_alignment
# - switch_case_on_newline
- syntactic_sugar
- todo
- toggle_bool
- trailing_closure
- trailing_comma
- trailing_newline
- trailing_semicolon
- trailing_whitespace
- type_name
# - unavailable_function
- unneeded_break_in_switch
- unneeded_parentheses_in_closure_argument
- untyped_error_in_catch
- unused_closure_parameter
- unused_control_flow_label
- unused_enumerated
- unused_optional_binding
- unused_setter_value
- valid_ibinspectable
- vertical_parameter_alignment
- vertical_parameter_alignment_on_call
- vertical_whitespace_closing_braces
- vertical_whitespace_opening_braces
- void_return
- weak_computed_property
- weak_delegate
- xct_specific_matcher
- xctfail_message
- yoda_condition
analyzer_rules:
- unused_import
- unused_private_declaration
force_cast: warning
force_unwrapping: warning
number_separator:
minimum_length: 5
object_literal:
image_literal: false
discouraged_object_literal:
color_literal: false
identifier_name:
max_length:
warning: 100
error: 100
min_length:
warning: 1
error: 1
validates_start_with_lowercase: false
allowed_symbols:
- '_'
excluded:
- 'x'
- 'y'
- 'a'
- 'b'
- 'x1'
- 'x2'
- 'y1'
- 'y2'
macOS_deployment_target: '10.12'
75 changes: 61 additions & 14 deletions WithExample.xcodeproj/project.pbxproj
Expand Up @@ -9,7 +9,6 @@
/* Begin PBXBuildFile section */
6533531521B671E80056BB34 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6533531421B671E80056BB34 /* AppDelegate.swift */; };
6533531721B671E80056BB34 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6533531621B671E80056BB34 /* ViewController.swift */; };
6533531A21B671E90056BB34 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6533531821B671E90056BB34 /* Main.storyboard */; };
6533531C21B671E90056BB34 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6533531B21B671E90056BB34 /* Assets.xcassets */; };
6533531F21B671E90056BB34 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6533531D21B671E90056BB34 /* LaunchScreen.storyboard */; };
6533532F21B6723B0056BB34 /* With.h in Headers */ = {isa = PBXBuildFile; fileRef = 6533532D21B6723B0056BB34 /* With.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -48,7 +47,6 @@
6533531121B671E80056BB34 /* WithExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WithExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
6533531421B671E80056BB34 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
6533531621B671E80056BB34 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
6533531921B671E90056BB34 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
6533531B21B671E90056BB34 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
6533531E21B671E90056BB34 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
6533532021B671E90056BB34 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -113,7 +111,6 @@
children = (
6533531421B671E80056BB34 /* AppDelegate.swift */,
6533531621B671E80056BB34 /* ViewController.swift */,
6533531821B671E90056BB34 /* Main.storyboard */,
6533531B21B671E90056BB34 /* Assets.xcassets */,
6533531D21B671E90056BB34 /* LaunchScreen.storyboard */,
6533532021B671E90056BB34 /* Info.plist */,
Expand Down Expand Up @@ -177,6 +174,7 @@
6533530E21B671E80056BB34 /* Frameworks */,
6533530F21B671E80056BB34 /* Resources */,
6533533721B6723B0056BB34 /* Embed Frameworks */,
F1CE26682281DC1200441836 /* ShellScript */,
);
buildRules = (
);
Expand All @@ -196,6 +194,7 @@
6533532721B6723B0056BB34 /* Sources */,
6533532821B6723B0056BB34 /* Frameworks */,
6533532921B6723B0056BB34 /* Resources */,
F1CE26692281DC1A00441836 /* ShellScript */,
);
buildRules = (
);
Expand All @@ -214,6 +213,7 @@
F16213E221FB6238005297DE /* Sources */,
F16213E321FB6238005297DE /* Frameworks */,
F16213E421FB6238005297DE /* Resources */,
F1CE266A2281DC2300441836 /* ShellScript */,
);
buildRules = (
);
Expand Down Expand Up @@ -273,7 +273,6 @@
files = (
6533531F21B671E90056BB34 /* LaunchScreen.storyboard in Resources */,
6533531C21B671E90056BB34 /* Assets.xcassets in Resources */,
6533531A21B671E90056BB34 /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -293,6 +292,60 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
F1CE26682281DC1200441836 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
};
F1CE26692281DC1A00441836 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
};
F1CE266A2281DC2300441836 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
6533530D21B671E80056BB34 /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down Expand Up @@ -330,14 +383,6 @@
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
6533531821B671E90056BB34 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
6533531921B671E90056BB34 /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
6533531D21B671E90056BB34 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
Expand Down Expand Up @@ -400,7 +445,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.1;
IPHONEOS_DEPLOYMENT_TARGET = 12.2;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -455,7 +500,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.1;
IPHONEOS_DEPLOYMENT_TARGET = 12.2;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
Expand All @@ -472,6 +517,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = WithExample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.2;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -490,6 +536,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
INFOPLIST_FILE = WithExample/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.2;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
Binary file not shown.

0 comments on commit de390eb

Please sign in to comment.