Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ryuichis/swift-3.1
Catch up with Swift 3.1 and swift-ast 0.1.4 changes
- Loading branch information
Showing
55 changed files
with
1,365 additions
and
1,177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2.3.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
swift-2.2-SNAPSHOT-2016-01-11-a | ||
3.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'rb-readline' | ||
gem 'colored' | ||
gem 'guard-shell' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
coderay (1.1.1) | ||
colored (1.2) | ||
ffi (1.9.18) | ||
formatador (0.2.5) | ||
guard (2.14.1) | ||
formatador (>= 0.2.4) | ||
listen (>= 2.7, < 4.0) | ||
lumberjack (~> 1.0) | ||
nenv (~> 0.1) | ||
notiffany (~> 0.0) | ||
pry (>= 0.9.12) | ||
shellany (~> 0.0) | ||
thor (>= 0.18.1) | ||
guard-compat (1.2.1) | ||
guard-shell (0.7.1) | ||
guard (>= 2.0.0) | ||
guard-compat (~> 1.0) | ||
listen (3.1.5) | ||
rb-fsevent (~> 0.9, >= 0.9.4) | ||
rb-inotify (~> 0.9, >= 0.9.7) | ||
ruby_dep (~> 1.2) | ||
lumberjack (1.0.11) | ||
method_source (0.8.2) | ||
nenv (0.3.0) | ||
notiffany (0.1.1) | ||
nenv (~> 0.1) | ||
shellany (~> 0.0) | ||
pry (0.10.4) | ||
coderay (~> 1.1.0) | ||
method_source (~> 0.8.1) | ||
slop (~> 3.4) | ||
rb-fsevent (0.9.8) | ||
rb-inotify (0.9.8) | ||
ffi (>= 0.5.0) | ||
rb-readline (0.5.4) | ||
ruby_dep (1.5.0) | ||
shellany (0.0.1) | ||
slop (3.6.0) | ||
thor (0.19.4) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
colored | ||
guard-shell | ||
rb-readline | ||
|
||
BUNDLED WITH | ||
1.13.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
require 'colored' | ||
require 'open3' | ||
|
||
clearing :on | ||
|
||
guard :shell do | ||
watch(/(.*).swift$/) {|m| | ||
|
||
puts "Running tests..." | ||
|
||
output = "" | ||
errors = "" | ||
exit_status = Open3.popen3("make test") do |stdin, stdout, stderr, wait_thr| | ||
stdin.close | ||
output << stdout.read | ||
errors << stderr.read | ||
wait_thr.value | ||
end | ||
|
||
puts output.yellow | ||
|
||
if exit_status.success? | ||
puts "Passed".green | ||
else | ||
puts errors | ||
puts "Failed".red | ||
end | ||
} | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,17 @@ | ||
SWIFT_BIN=$(shell which swift) | ||
SWIFT_LINT=$(SWIFT_BIN)-lint | ||
|
||
SWIFTC=swiftc | ||
COPY=cp | ||
REMOVE=rm | ||
|
||
UNAME=$(shell uname) | ||
|
||
ifeq ($(UNAME), Darwin) | ||
XCODE=$(shell xcode-select -p) | ||
SDK=$(XCODE)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk | ||
TARGET=x86_64-apple-macosx10.10 | ||
SWIFTC=swiftc -target $(TARGET) -sdk $(SDK) -Xlinker -all_load | ||
COPY=sudo cp | ||
REMOVE=sudo rm | ||
endif | ||
|
||
BUILD_DIR=.build/debug | ||
LIBS=$(wildcard $(BUILD_DIR)/*.a) | ||
LDFLAGS=$(foreach lib,$(LIBS),-Xlinker $(lib)) | ||
|
||
.PHONY: all clean build test install uninstall | ||
.PHONY: all clean build test xcodegen | ||
|
||
all: build | ||
|
||
clean: | ||
swift build --clean | ||
swift package clean | ||
|
||
build: | ||
swift build | ||
|
||
test: build $(BUILD_DIR)/test_runner | ||
./$(BUILD_DIR)/test_runner | ||
|
||
$(BUILD_DIR)/test_runner: Tests/*.swift Tests/rule/*.swift Tests/reporter/*.swift $(BUILD_DIR)/lint.a | ||
$(SWIFTC) -o $@ Tests/*.swift Tests/rule/*.swift Tests/reporter/*.swift -I$(BUILD_DIR) -Xlinker $(BUILD_DIR)/Spectre.a $(LDFLAGS) | ||
|
||
install: | ||
$(COPY) $(BUILD_DIR)/swift-lint $(SWIFT_LINT) | ||
test: build | ||
swift test | ||
|
||
uninstall: | ||
$(REMOVE) $(SWIFT_LINT) | ||
xcodegen: | ||
swift package generate-xcodeproj --enable-code-coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"autoPin": true, | ||
"pins": [ | ||
{ | ||
"package": "swift-ast", | ||
"reason": null, | ||
"repositoryURL": "https://github.com/yanagiba/swift-ast", | ||
"version": "0.1.4" | ||
} | ||
], | ||
"version": 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
Copyright 2015-2017 Ryuichi Saito, LLC and the Yanagiba project contributors | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
import AST | ||
|
||
protocol ASTVisitorRule : Rule, ASTVisitor { | ||
} | ||
|
||
extension ASTVisitorRule where Self: RuleBase { | ||
func inspect(_ astContext: ASTContext, configurations: [String: Any]? = nil) { | ||
self.astContext = astContext | ||
self.configurations = configurations | ||
|
||
_ = try? traverse(astContext.topLevelDeclaration) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.