Skip to content
Permalink
Browse files

CI에 swiftformat 도입하고 HACKING에 문서화 (#613)

  • Loading branch information...
presto95 committed Sep 29, 2019
1 parent 629ae00 commit 307a1e6cd6779c65789a53bc570489bcdef557c3
Showing with 93 additions and 85 deletions.
  1. +2 −1 .travis.yml
  2. +1 −1 GureumTests/GureumTests.swift
  3. +42 −43 GureumTests/MockApp.swift
  4. +8 −0 HACKING.md
  5. +40 −40 Preferences/Preferences.swift
@@ -5,7 +5,7 @@ osx_image: xcode11
install:
- gem update cocoapods
- pod install --repo-update
- brew install shellcheck
- brew install shellcheck swiftformat
matrix:
include:
- osx_image: xcode10.2
@@ -18,4 +18,5 @@ matrix:
# xcode_destination: platform=iOS Simulator,OS=11.3,name=iPhone X
script:
- shellcheck tools/*.sh
- swiftformat --lint OSXCore/ OSX/ GureumTests/ Preferences/ OSXTestApp/
- set -o pipefail && xcodebuild -workspace Gureum.xcworkspace -scheme OSX -sdk macosx -destination platform\=macOS build test | xcpretty
@@ -209,7 +209,7 @@ class GureumTests: XCTestCase {
XCTAssertEqual("", app.client.markedString(), "buffer: \(app.client.string), app: \(app)")
}
}

func testHanjaBlank() {
for app in apps {
if app == terminal {
@@ -24,7 +24,7 @@ class VirtualApp: NSObject {
controller.updateComposition()
return processed
}

@discardableResult
func inputText(_ string: String!, key keyCode: KeyCode, modifiers flags: NSEvent.ModifierFlags = NSEvent.ModifierFlags(rawValue: 0)) -> Bool {
let processed = controller.inputText(string, key: keyCode.rawValue, modifiers: Int(flags.rawValue), client: client)
@@ -45,7 +45,6 @@ class VirtualApp: NSObject {
}
return inputText(string, key: keyCode, modifiers: flags)
}

}

class ModerateApp: VirtualApp {
@@ -59,50 +58,50 @@ class ModerateApp: VirtualApp {
return processed
}
}
/*
@implementation TerminalApp

- (BOOL)inputText:(NSString *)text key:(NSInteger)keyCode modifiers:(NSEventModifierFlags)flags {
BOOL processed = NO;
if (self.client.hasMarkedText) {
processed = [super inputText:text key:keyCode modifiers:flags];
if (keyCode == 36) {
processed = YES;
}
}
else {
if (keyCode == 36) {
[self.client insertText:text];
processed = YES;
} else {
processed = [super inputText:text key:keyCode modifiers:flags];
}
}
if (!processed) {
[self.client insertText:text replacementRange:self.client.markedRange];
}
return processed;
}
/*
@implementation TerminalApp
@end
- (BOOL)inputText:(NSString *)text key:(NSInteger)keyCode modifiers:(NSEventModifierFlags)flags {
BOOL processed = NO;
if (self.client.hasMarkedText) {
processed = [super inputText:text key:keyCode modifiers:flags];
if (keyCode == 36) {
processed = YES;
}
}
else {
if (keyCode == 36) {
[self.client insertText:text];
processed = YES;
} else {
processed = [super inputText:text key:keyCode modifiers:flags];
}
}
if (!processed) {
[self.client insertText:text replacementRange:self.client.markedRange];
}
return processed;
}
@end
@implementation GreedyApp
@implementation GreedyApp
- (BOOL)inputText:(NSString *)text key:(NSInteger)keyCode modifiers:(NSEventModifierFlags)flags {
BOOL processed = NO;
if (self.client.hasMarkedText) {
processed = [super inputText:text key:keyCode modifiers:flags];
}
else {
processed = [super inputText:text key:keyCode modifiers:flags];
if (self.client.markedRange.length == 0 || !processed) {
// FIXME: Commited string should be removed too.
[self.client insertText:text replacementRange:self.client.markedRange];
}
}
return processed;
}
- (BOOL)inputText:(NSString *)text key:(NSInteger)keyCode modifiers:(NSEventModifierFlags)flags {
BOOL processed = NO;
if (self.client.hasMarkedText) {
processed = [super inputText:text key:keyCode modifiers:flags];
}
else {
processed = [super inputText:text key:keyCode modifiers:flags];
if (self.client.markedRange.length == 0 || !processed) {
// FIXME: Commited string should be removed too.
[self.client insertText:text replacementRange:self.client.markedRange];
}
}
return processed;
}
@end
*/
@end
*/
@@ -99,3 +99,11 @@ sudo gem install xcpretty

* Firefox.app : 단축키 입력을 선점하지 않습니다. Modifier를 수정했다면 테스트해 보아야 합니다.
* MS 오피스 2011 : 화살표 키 등 일부 다른 프로그램에서는 전달하지 않는 키코드가 전달됩니다. (issue #3)

변경한 소스 코드에 대해 swiftformat을 실행하여 코드의 일관성을 유지해 주세요. CI 과정에서 swiftformat으로 인한 변경 사항이 발견되면 빌드는 통과되지 않습니다.

```sh
# 예시
swiftformat OSXCore/
```

0 comments on commit 307a1e6

Please sign in to comment.
You can’t perform that action at this time.