-
Notifications
You must be signed in to change notification settings - Fork 23
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 amplitude/lint-setup-code-refactor
feat: setup lint, jira issue create, fix all file lint issues, update config
- Loading branch information
Showing
20 changed files
with
399 additions
and
277 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,21 @@ | ||
# Creates jira tickets for new github issues to help triage | ||
name: Jira Issue Creator For Kotlin | ||
|
||
on: | ||
issues: | ||
types: [opened] | ||
workflow_call: | ||
inputs: | ||
label: | ||
type: string | ||
|
||
jobs: | ||
call-workflow-passing-data: | ||
uses: amplitude/Amplitude-TypeScript/.github/workflows/jira-issue-create-template.yml@main | ||
with: | ||
label: "Swift" | ||
secrets: | ||
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} | ||
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} | ||
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} | ||
JIRA_PROJECT: ${{ secrets.JIRA_PROJECT }} |
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,19 @@ | ||
name: Lint | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
runs-on: macos-12 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set Xcode 14 | ||
run: | | ||
sudo xcode-select -switch /Applications/Xcode_14.1.app | ||
- name: Lint | ||
run: swiftlint |
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,6 @@ | ||
disabled_rules: | ||
- function_body_length | ||
- trailing_comma | ||
identifier_name: | ||
allowed_symbols: "_" | ||
min_length: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,82 @@ | ||
public class Amplitude { | ||
var configuration: Configuration | ||
var instanceName: String | ||
init(configuration: Configuration, instanceName: String = "default") { | ||
init( | ||
configuration: Configuration, | ||
instanceName: String = Constants.Configuration.DEFAULT_INSTANCE | ||
) { | ||
self.configuration = configuration | ||
self.instanceName = instanceName | ||
} | ||
|
||
|
||
convenience init(apiKey: String, configuration: Configuration) { | ||
configuration.apiKey = apiKey | ||
self.init(configuration: configuration) | ||
} | ||
|
||
func getInstance(instsanceName: String) -> Amplitude { | ||
return self | ||
} | ||
|
||
func track() -> Amplitude { | ||
return self | ||
} | ||
|
||
|
||
@available(*, deprecated, message: "use 'track' instead") | ||
func logEvent() -> Amplitude { | ||
return self | ||
} | ||
|
||
func identify(type: String) -> Amplitude { | ||
return self | ||
} | ||
|
||
func identify() -> Amplitude { | ||
return self | ||
} | ||
|
||
func groupIdentify() -> Amplitude { | ||
return self | ||
} | ||
|
||
func groupIdentify(groupType: String, groupName: String, groupProperties: [String: Any], options: [String: Any]) -> Amplitude { | ||
|
||
func groupIdentify( | ||
groupType: String, | ||
groupName: String, | ||
groupProperties: [String: Any], | ||
options: [String: Any] | ||
) -> Amplitude { | ||
return self | ||
} | ||
|
||
func logRevenue() -> Amplitude { | ||
return self | ||
} | ||
|
||
func revenue() -> Amplitude { | ||
return self | ||
} | ||
|
||
func add(plugin: Plugin) -> Amplitude { | ||
return self | ||
} | ||
|
||
func remove(plugin: Plugin) -> Amplitude { | ||
return self | ||
} | ||
|
||
func flush() -> Amplitude { | ||
return self | ||
} | ||
|
||
func setUserId(userId: String) -> Amplitude { | ||
return self | ||
} | ||
|
||
func setDeviceId(deviceId: String) -> Amplitude { | ||
return self | ||
} | ||
|
||
func reset() -> Amplitude { | ||
return self | ||
} | ||
} | ||
|
||
func amplitude(apiKey: String, configs: Configuration) -> Amplitude { | ||
return Amplitude(configuration: Configuration(flushQueueSize: <#Int#>, flushIntervalMillis: <#Int#>, instanceName: <#String#>, optOut: <#Bool#>, storageProvider: <#Storage#>, logLvel: <#LogLevelEnum#>, loggerProvider: <#Logger#>, flushMaxRetries: <#Int#>, useBatch: <#Bool#>, serverZone: <#ServerZone#>), instanceName: "default") | ||
} |
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
Oops, something went wrong.