Skip to content

Commit

Permalink
Add swiftlint config
Browse files Browse the repository at this point in the history
  • Loading branch information
ra1028 committed Mar 29, 2019
1 parent 14c8424 commit dccf90e
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# https://github.com/realm/SwiftLint

excluded:
- Tests/XCTestManifests.swift

disabled_rules:
- type_name
- identifier_name
- force_cast
- xctfail_message
- function_body_length
- file_length

nesting:
type_level:
warning: 2

line_length:
warning: 200

file_length:
warning: 600

type_body_length:
warning: 400

function_body_length:
warning: 50

cyclomatic_complexity:
warning: 12

statement_position:
statement_mode: uncuddled_else
22 changes: 22 additions & 0 deletions DifferenceKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@
6B2DF86A210E2C12004D2D40 /* Frameworks */,
6B2DF86B210E2C12004D2D40 /* Headers */,
6B2DF86C210E2C12004D2D40 /* Resources */,
6B7EEDA4224E5A5000060872 /* SwiftLint */,
);
buildRules = (
);
Expand Down Expand Up @@ -263,6 +264,27 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
6B7EEDA4224E5A5000060872 /* SwiftLint */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = SwiftLint;
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 */
6B2DF869210E2C12004D2D40 /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down
2 changes: 2 additions & 0 deletions Sources/Algorithm.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// swiftlint:disable cyclomatic_complexity

public extension StagedChangeset where Collection: RangeReplaceableCollection, Collection.Element: Differentiable {
/// Creates a new `StagedChangeset` from the two collections.
///
Expand Down

0 comments on commit dccf90e

Please sign in to comment.