Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/swiftformat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: SwiftFormat

on:
pull_request:
branches: [ main ]
push:
branches: [ main ]

jobs:
swiftformat:
name: SwiftFormat
runs-on: macos-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install SwiftFormat
run: brew install swiftformat

- name: Run SwiftFormat
run: swiftformat --lint .
22 changes: 22 additions & 0 deletions .github/workflows/swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: SwiftLint

on:
pull_request:
branches: [ main ]
push:
branches: [ main ]

jobs:
swiftlint:
name: SwiftLint
runs-on: macos-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install SwiftLint
run: brew install swiftlint

- name: Run SwiftLint
run: swiftlint lint --reporter github-actions-logging
3 changes: 2 additions & 1 deletion .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
--indent-case false
--indent-strings false
--xcode-indentation enabled
--wrap-conditions preserve

# MARK: - Imports and Headers
--import-grouping testable-last
Expand All @@ -50,7 +51,7 @@
--ifdef indent

# MARK: - SwiftUI and Modern Swift Features
--swift-version 6.0
--swift-version 6.2
--sort-swiftui-properties first-appearance-sort
--some-any true
--short-optionals always
Expand Down
64 changes: 64 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Minimal SwiftLint configuration
# SwiftFormat handles all formatting, so SwiftLint focuses on code quality and best practices

disabled_rules:
- line_length
- opening_brace
- function_parameter_count
- nesting
- large_tuple
- type_name
- force_unwrapping
- blanket_disable_command

opt_in_rules:
- array_init
- contains_over_first_not_nil
- convenience_type
- discouraged_assert
- discouraged_object_literal
- empty_count
- empty_string
- empty_xctest_method
- explicit_init
- fatal_error_message
- first_where
- force_cast
- force_try
- implicit_return
- joined_default_parameter
- last_where
- legacy_random
- lower_acl_than_parent
- multiline_function_chains
- multiline_parameters
- multiline_parameters_brackets
- no_fallthrough_only
- operator_usage_whitespace
- overridden_super_call
- prohibited_super_call
- redundant_nil_coalescing
- single_test_class
- sorted_first_last
- static_operator
- switch_case_alignment
- trailing_closure
- unavailable_function
- unneeded_parentheses_in_closure_argument
- unused_control_flow_label
- vertical_whitespace_closing_braces
- xct_specific_matcher
- xctfail_message
- yoda_condition

multiline_parameters:
allows_single_line: false

excluded:
- .build
- "**/.build"
- DerivedData
- Pods
- Carthage
- .git
- node_modules
10 changes: 5 additions & 5 deletions Stenographer/Extensions/TimeInterval+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ extension TimeInterval {

var srtTimecode: String {
let totalMilliseconds = Int(self * 1000)
let ms = totalMilliseconds % 1000
let milliseconds = totalMilliseconds % 1000
let totalSeconds = totalMilliseconds / 1000
let s = totalSeconds % 60
let m = (totalSeconds / 60) % 60
let h = totalSeconds / 3600
let seconds = totalSeconds % 60
let minutes = (totalSeconds / 60) % 60
let hours = totalSeconds / 3600

return String(format: "%02d:%02d:%02d,%03d", h, m, s, ms)
return String(format: "%02d:%02d:%02d,%03d", hours, minutes, seconds, milliseconds)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class TranscriptionViewModel {

var wordCount: Int {
transcriptionText
.split(whereSeparator: { $0.isWhitespace || $0.isNewline })
.split { $0.isWhitespace || $0.isNewline }
.count
}

Expand Down
Loading