Skip to content

Commit

Permalink
SwiftLint Configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
lfaoro committed Oct 3, 2015
1 parent b7b66ce commit b6c4bc6
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 31 deletions.
8 changes: 5 additions & 3 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
included:
- Cast
disabled_rules:
- function_body_length
- function_body_length
- todo
included:
- Cast
excluded:
21 changes: 18 additions & 3 deletions Cast.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,9 @@
A13145DE1B5AA34E00AA4406 /* Resources */,
A17A19D21B9104F6005CB0A5 /* Copy Files - Frameworks */,
A1A650301BB08E5800E97172 /* Setup Script */,
A15049661B6978A5009BF6A9 /* Tags Script */,
A150495F1B6940D9009BF6A9 /* Carthage Script */,
A1A655AE1BBFDFED00E6A11C /* SwiftLint Script */,
A15049661B6978A5009BF6A9 /* Tags Script */,
);
buildRules = (
);
Expand Down Expand Up @@ -460,8 +461,22 @@
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/zsh;
shellScript = "#${PROJECT_DIR}/scripts/setup";
shellPath = /bin/bash;
shellScript = "${PROJECT_DIR}/scripts/setup";
};
A1A655AE1BBFDFED00E6A11C /* SwiftLint Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "SwiftLint Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = swiftlint;
};
/* End PBXShellScriptBuildPhase section */

Expand Down
2 changes: 1 addition & 1 deletion Cast/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,5 @@ func keepRecent(URL url: NSURL) {
let description = String("\(url.host!)\(url.path!)".characters.prefix(30))

recentURLS[description] = url.relativeString!

}
8 changes: 4 additions & 4 deletions Cast/MenuSendersAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ final class MenuSendersAction: NSObject {

case .File(let file):
print(file.path!)

default: break

}
})
}
Expand Down Expand Up @@ -163,8 +163,8 @@ final class MenuSendersAction: NSObject {
sender.state = 0
}
}

func openOptionsWindow(sender: NSMenuItem) {

}
}
4 changes: 3 additions & 1 deletion Cast/OAuthClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ public class OAuthClient: NSObject {

public class func revoke() -> NSError? {
let keychain = Keychain(service: "com.lfaoro.cast.github-token")
let revokeURL = NSURL(string: "https://github.com/settings/connections/applications/" + "ef09cfdbba0dfd807592")!
let revokeURL = NSURL(
string: "https://github.com/settings/connections/applications/" +
"ef09cfdbba0dfd807592")!

NSWorkspace.sharedWorkspace().openURL(revokeURL)

Expand Down
2 changes: 0 additions & 2 deletions Cast/ShortenClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,4 @@ public class ShortenClient {
return NopDisposable.instance
}
}


}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Cast will also help you shorten URLs very quickly using your preferred URL short

**Folders and Files** which will be automatically zipped for you before uploading
- [ ] [iCloud Drive](http://www.apple.com/icloud/icloud-drive/)
- [ ] [DropBox](http://dropbox.com)
- [ ] [Dropbox](http://dropbox.com)

**URL Shorteners**
- [x] [hive.am](www.hive.am)
Expand Down
29 changes: 13 additions & 16 deletions Scripts/setup
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#!/bin/zsh
echo
echo "\e[0m"

# This script will run during an Xcode - Run Script Phase
checkXcode() {
required_xcode_version=700

if [ ${XCODE_VERSION_ACTUAL} -lt ${required_xcode_version} ]
then
if [[ ${XCODE_VERSION_ACTUAL} -lt ${required_xcode_version} ]]; then
echo "\e[1;31m Error: Xcode ${required_xcode_version} or later is required to build ${PRODUCT_NAME} \e[0m"
exit 1
exit 2
else
echo "\e[1;32m Good: 'Xcode' version is ${XCODE_VERSION_ACTUAL} \e[0m"

Expand All @@ -22,8 +21,7 @@ checkXcode() {

checkFrameworks() {
items=`ls ${PROJECT_DIR}/Carthage/build/Mac |grep framework$ |wc -l`
if [ $items -ge 7 ]
then
if [ $items -ge 7 ]; then
echo "\e[1;32m Good: All frameworks are present \e[0m"
else
echo "\e[1;31m Bad: Frameworks missing, bootstrapping \e[0m"
Expand All @@ -33,10 +31,9 @@ checkFrameworks() {
}

checkBrew() {
local brew=`where brew`
local brew=`whereis brew`

if [ -x $brew ]
then
if [ -x $brew ]; then
echo "\e[1;32m Good: 'Homebrew' is installed in $brew \e[0m"
else
echo "\e[1;31m Bad: 'Homebrew' is not installed... \e[0m"
Expand All @@ -49,9 +46,8 @@ checkBrew() {
}

checkCarthage() {
local carthage=`where carthage`
if [ -x $carthage ]
then
local carthage=`whereis carthage`
if [ -x $carthage ]; then
echo "\e[1;32m Good: 'Carthage' is installed in $carthage \e[0m"
else
checkBrew
Expand All @@ -60,22 +56,23 @@ checkCarthage() {
echo "\e[1;36m Fix: installing 'Carthage' \e[0m"
brew install carthage
sleep 1
brew link carthage
checkCarthage
fi
}

checkSwiftLint() {
local swiftlint=`where swiftlint`
if [ -x $swiftlint ]
then
echo "\e[1;32m Good: 'SwiftLint' is installed in $swiftlint \e[0m"
local swiftlint=`whereis swiftlint`
if [ -x $swiftlint ]; then
echo "\e[1;32m Good: 'SwiftLint' is installed \e[0m"
else
checkBrew
echo "\e[1;36m updating 'brew'... \e[0m"
brew update >>/dev/null
echo "\e[1;36m Fix: installing 'SwiftLint' \e[0m"
brew install swiftlint
sleep 1
brew link swiftlint
checkSwiftLint
fi
}
Expand Down

0 comments on commit b6c4bc6

Please sign in to comment.