Skip to content

Commit

Permalink
commit last state of develop_pre_signing_and_merge_commit_rules
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-dydx committed Aug 21, 2024
1 parent d142961 commit dd6b0f7
Show file tree
Hide file tree
Showing 5,133 changed files with 997,824 additions and 13 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
26 changes: 26 additions & 0 deletions .github/workflows/SwiftLint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: SwiftLint on Changed Files

on:
pull_request:
paths:
- '**/*.swift'

jobs:
swiftlint:
runs-on: macos-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Install SwiftLint
run: |
brew install swiftlint
- name: Lint Modified Swift Files
run: |
# Fetch changes from the base branch of the pull request
git fetch origin ${{ github.base_ref }}
# Use git diff to find changed Swift files, then lint each file with SwiftLint
git diff --name-only origin/${{ github.base_ref }} | grep '\.swift$' | xargs swiftlint --config dydx/.swiftlint.yml --fix lint
20 changes: 19 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,25 @@
dydx/fastlane
dydx/Pods/abacus/.gradle
dydx/Pods/abacus/build
dydx/Pods/Abacus
dydxV4/dydxV4/_Configurations/credentials.json
dydxV4/dydxV4/_Configurations/GoogleService-Info-Staging.plist
dydxV4/dydxV4/_Configurations/GoogleService-Info.plist
scripts/secrets
scripts/secrets
scripts/percy_test.sh

# fastlane specific
**/fastlane/report.xml

# deliver temporary files
**/fastlane/Preview.html

# scan temporary files
**/fastlane/test_output

*.p12
*.certSigningRequest
*.cer
*.mobileprovision
*.ipa
*.dSYM.*
937 changes: 937 additions & 0 deletions AmplitudeInjections/AmplitudeInjections.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# ``AmplitudeInjections``

<!--@START_MENU_TOKEN@-->Summary<!--@END_MENU_TOKEN@-->

## Overview

<!--@START_MENU_TOKEN@-->Text<!--@END_MENU_TOKEN@-->

## Topics

### <!--@START_MENU_TOKEN@-->Group<!--@END_MENU_TOKEN@-->

- <!--@START_MENU_TOKEN@-->``Symbol``<!--@END_MENU_TOKEN@-->
18 changes: 18 additions & 0 deletions AmplitudeInjections/AmplitudeInjections/AmplitudeInjections.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// AmplitudeInjections.h
// AmplitudeInjections
//
// Created by John Huang on 4/19/22.
//

#import <Foundation/Foundation.h>

//! Project version number for AmplitudeInjections.
FOUNDATION_EXPORT double AmplitudeInjectionsVersionNumber;

//! Project version string for AmplitudeInjections.
FOUNDATION_EXPORT const unsigned char AmplitudeInjectionsVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <AmplitudeInjections/PublicHeader.h>


Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
//
// AmplitudeTracking.swift
// AmplitudeInjections
//
// Created by John Huang on 4/19/22.
//

import AmplitudeSwift
import PlatformParticles
import Utilities

open class AmplitudeTracking: TransformerTracker {

private let amplitude: Amplitude

public init(_ apiKey: String) {
self.amplitude = Amplitude.init(configuration: .init(apiKey: apiKey))
super.init()
}

override open func log(event: String, data: [String: Any]?, revenue: NSNumber?) {
if !excluded {
var data = data
if let revenue = revenue {
if data == nil {
data = [String: Any]()
}
data?["$revenue"] = revenue
}
Console.shared.log("analytics log | Amplitude: logging event \(event) with data: \((data ?? [:]).description)")
let event = BaseEvent(eventType: event, eventProperties: data)
amplitude.track(event: event)
}
}

override public func setUserId(_ userId: String?) {
Console.shared.log("analytics log | Amplitude: User ID set to: `\(userId ?? "nil")`")
amplitude.setUserId(userId: userId)
}

// https://amplitude.com/docs/sdks/analytics/ios/ios-swift-sdk#identify
override public func setValue(_ value: Any?, forUserProperty userProperty: String) {
Console.shared.log("analytics log | Amplitude: User Property `\(userProperty)` set to: \(value ?? "nil")")
let identify = Identify()
if value != nil {
identify.set(property: userProperty, value: value)
} else {
identify.unset(property: userProperty)
}
amplitude.identify(identify: identify)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// AmplitudeInjectionsTests.swift
// AmplitudeInjectionsTests
//
// Created by John Huang on 4/19/22.
//

import XCTest
@testable import AmplitudeInjections

class AmplitudeInjectionsTests: XCTestCase {

override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}

func testExample() throws {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
// Any test you write for XCTest can be annotated as throws and async.
// Mark your test throws to produce an unexpected failure when your test encounters an uncaught error.
// Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards.
}

func testPerformanceExample() throws {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}

}
Loading

0 comments on commit dd6b0f7

Please sign in to comment.