Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use SwiftLint via CocoaPods #78

Merged
merged 9 commits into from
Apr 9, 2018
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
disabled_rules:
- type_name

opt_in_rules:
- force_unwrapping
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍, + 💯


# Rules customization
line_length:
warning: 120
error: 200

nesting:
type_level:
warning: 2
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ _None_

### Internal Changes

_None_
* Switched to using SwiftLint via CocoaPods instead of our own install scripts.
[David Jennes](https://github.com/djbe)
[#78](https://github.com/SwiftGen/StencilSwiftKit/pull/78)

## 2.4.0

Expand Down
1 change: 1 addition & 0 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ use_frameworks!

target 'Tests' do
pod 'StencilSwiftKit', path: '.'
pod 'SwiftLint', '~> 0.25'
end
9 changes: 6 additions & 3 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ PODS:
- PathKit (~> 0.8.0)
- StencilSwiftKit (2.4.0):
- Stencil (~> 0.10)
- SwiftLint (0.25.0)

DEPENDENCIES:
- StencilSwiftKit (from `.`)
- SwiftLint (~> 0.25)

EXTERNAL SOURCES:
StencilSwiftKit:
Expand All @@ -15,8 +17,9 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
PathKit: dcab05d701474011aae0e40cf892298a831f63d6
Stencil: 40b382c52edab08f1e800e6144c1f04ae47a7a9a
StencilSwiftKit: 41693610fdab5a3782f9722b420d87eb4b287f33
StencilSwiftKit: 385f50e5263290411a059dadcbbc153b4f242f3c
SwiftLint: e14651157288e9e01d6e1a71db7014fb5744a8ea

PODFILE CHECKSUM: a08ecc2ab2ae91e8f0cddb740ac4e30be2cffc7d
PODFILE CHECKSUM: 4f35313d732240f2655b591ec8ce3f742e804e98

COCOAPODS: 1.3.1
COCOAPODS: 1.4.0
9 changes: 6 additions & 3 deletions Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

637 changes: 334 additions & 303 deletions Pods/Pods.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions Pods/SwiftLint/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Pods/SwiftLint/swiftlint
Binary file not shown.
8 changes: 4 additions & 4 deletions Pods/Target Support Files/PathKit/PathKit.xcconfig

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 38 additions & 6 deletions Pods/Target Support Files/Pods-Tests/Pods-Tests-frameworks.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Pods/Target Support Files/Stencil/Stencil.xcconfig

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions Scripts/SwiftLint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

SWIFTLINT="$(PWD)/Pods/SwiftLint/swiftlint"
CONFIG="$(PWD)/.swiftlint.yml"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


# possible paths
paths_sources="Sources"
paths_tests="Tests"

# load selected group
if [ $# -gt 0 ]; then
key="$1"
else
echo "error: need group to lint."
exit 1
fi

selected_path=`eval echo '$'paths_$key`
if [ -z "$selected_path" ]; then
echo "error: need a valid group to lint."
exit 1
fi

"$SWIFTLINT" lint --strict --config "$CONFIG" --path "${PWD}/${selected_path}"
2 changes: 1 addition & 1 deletion StencilSwiftKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if [[ ! $CI ]]; then\n [[ -r ~/.profile ]] && source ~/.profile\n if [[ `which bundler` ]]; then\n bundle exec rake lint:code\n bundle exec rake lint:tests\n else\n echo \"warning: bundler not found, can't lint code. Please install bundler then run bundle install.\"\n fi\nfi";
shellScript = "if [[ ! $CI ]]; then\n \"$SRCROOT/Scripts/SwiftLint.sh\" \"sources\"\n \"$SRCROOT/Scripts/SwiftLint.sh\" \"tests\"\nfi";
};
DE127EA8748200EF28090721 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
Expand Down
Loading