Skip to content

Commit

Permalink
Format fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
paulb777 committed Sep 16, 2024
1 parent eab83e2 commit 36f1b40
Show file tree
Hide file tree
Showing 167 changed files with 111 additions and 19,984 deletions.
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# See https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties
# for all available properties.

# Top-most EditorConfig file for the firebase-ios-sdk repo.
root = true

# Defaults for all files
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

# ObjC and Swift files
# See https://developer.apple.com/documentation/xcode-release-notes/xcode-16-release-notes#New-Features-in-Xcode-16-Beta
# for the subset of properties supported by Xcode.
[*.{h,m,mm,swift}]
indent_style = space
indent_size = 2
max_line_length = 100
54 changes: 54 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: check

on:
pull_request:
push:
branches: main

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
check:
runs-on: macos-latest
env:
MINT_PATH: ${{ github.workspace }}/mint
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v3
with:
python-version: '3.10'

- name: Cache Mint packages
uses: actions/cache@v3
with:
path: ${{ env.MINT_PATH }}
key: ${{ runner.os }}-mint-${{ hashFiles('**/Mintfile') }}
restore-keys: ${{ runner.os }}-mint-

- name: Setup Scripts Directory
run: ./setup-scripts.sh

- name: Setup check
run: |
brew update
brew install clang-format@18
brew install mint
mint bootstrap
- name: Style
run: scripts/style.sh test-only

- name: Whitespace
run: scripts/check_whitespace.sh

- name: Filename spaces
run: scripts/check_filename_spaces.sh

- name: Copyrights
run: scripts/check_copyright.sh

- name: Imports
run: scripts/check_imports.swift
14 changes: 14 additions & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Formatting Options - Mimic Google style
--indent 2
--maxwidth 100
--wrapparameters afterfirst

# Disabled Rules

# Too many of our swift files have simplistic examples. While technically
# it's correct to remove the unused argument labels, it makes our examples
# look wrong.
--disable unusedArguments

# We prefer trailing braces.
--disable wrapMultilineStatementBraces
7 changes: 0 additions & 7 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

This file was deleted.

This file was deleted.

1 change: 1 addition & 0 deletions Mintfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nicklockwood/[email protected]
9 changes: 4 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import class Foundation.ProcessInfo
import PackageDescription

//let firebaseVersion = "10.25.0"
// let firebaseVersion = "10.25.0"

let package = Package(
name: "FirebaseDataConnect",
Expand All @@ -28,7 +28,7 @@ let package = Package(
.library(
name: "FirebaseDataConnect",
targets: ["FirebaseDataConnect"]
)
),
],
dependencies: [
.package(url: "https://github.com/firebase/firebase-ios-sdk",
Expand All @@ -44,7 +44,7 @@ let package = Package(
dependencies: [
.product(name: "GRPC", package: "grpc-swift"),
.product(name: "FirebaseAuth", package: "firebase-ios-sdk"),
.product(name: "FirebaseAppCheck", package: "firebase-ios-sdk")
.product(name: "FirebaseAppCheck", package: "firebase-ios-sdk"),

],
path: "Sources"
Expand All @@ -57,7 +57,6 @@ let package = Package(
resources: [
.copy("Resources/fdc-kitchensink"),
]
)
),
]
)

2 changes: 1 addition & 1 deletion Sources/OptionalVarWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Foundation
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
@propertyWrapper
public struct OptionalVariable<Value> where Value: Encodable {
public private(set) var isSet: Bool = false
public private(set) var isSet = false

public var wrappedValue: Value? {
didSet {
Expand Down
12 changes: 6 additions & 6 deletions Sources/Scalars/LocalDate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ public struct LocalDate: Codable, Equatable, CustomStringConvertible {
}

@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension LocalDate {
public init(from decoder: any Decoder) throws {
public extension LocalDate {
init(from decoder: any Decoder) throws {
let container = try decoder.singleValueContainer()
let localDateString = try container.decode(String.self)

Expand All @@ -87,7 +87,7 @@ extension LocalDate {
dateComponents = calendar.dateComponents(components, from: date)
}

public func encode(to encoder: any Encoder) throws {
func encode(to encoder: any Encoder) throws {
var container = encoder.singleValueContainer()
let formattedDate = dateFormatter.string(from: date)
try container.encode(formattedDate)
Expand All @@ -97,12 +97,12 @@ extension LocalDate {
// MARK: Equatable, Comparable

@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
extension LocalDate {
public static func < (lhs: LocalDate, rhs: LocalDate) -> Bool {
public extension LocalDate {
static func < (lhs: LocalDate, rhs: LocalDate) -> Bool {
return lhs.date < rhs.date
}

public static func == (lhs: LocalDate, rhs: LocalDate) -> Bool {
static func == (lhs: LocalDate, rhs: LocalDate) -> Bool {
return lhs.date == rhs.date
}
}
Expand Down
1 change: 0 additions & 1 deletion Tests/Integration/KitchenSinkClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.


import FirebaseDataConnect
import Foundation

Expand Down
1 change: 0 additions & 1 deletion Tests/Integration/KitchenSinkKeys.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.


import Foundation

import FirebaseDataConnect
Expand Down
1 change: 0 additions & 1 deletion Tests/Integration/KitchenSinkOperations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.


import FirebaseDataConnect
import Foundation

Expand Down
Loading

0 comments on commit 36f1b40

Please sign in to comment.