Skip to content

Commit

Permalink
Formatted code using SwiftLint
Browse files Browse the repository at this point in the history
  • Loading branch information
IhorShevchuk committed Apr 12, 2024
1 parent e33f81d commit 56ab02e
Show file tree
Hide file tree
Showing 10 changed files with 142 additions and 30 deletions.
68 changes: 68 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
disabled_rules: # rule identifiers to exclude from running
- todo
- file_header
opt_in_rules: # list of the rules that are disabled by default BUT enabled by our team
- closing_brace
- opening_brace
- return_arrow_whitespace
- trailing_semicolon
- statement_position
- explicit_init
- shorthand_operator
- deployment_target
- duplicate_imports
- empty_string
- overridden_super_call
- prohibited_super_call
- protocol_property_accessors_order
- redundant_objc_attribute
- redundant_type_annotation
- empty_count
- array_init
- function_body_length
- cyclomatic_complexity
# Find all the available rules by running:
# swiftlint rules
analyzer_rules:
- unused_import
included: # paths to include during linting. `--path` is ignored if present.
excluded: # paths to ignore during linting. Takes precedence over `included`.
- ${SRCROOT}/fastlane/swift
- ${SRCROOT}/TippyTalker/fastlane/swift
- ${SRCROOT}/BuildOutput
- ${SRCROOT}/BuildDerivedData/SourcePackages


# configurable rules can be customized from this configuration file
# binary rules can set their severity level
trailing_semicolon: error
closing_brace: error
opening_brace:
severity: error
return_arrow_whitespace: error
statement_position:
severity: error
colon:
severity: error
comma: error
force_try: error
force_cast: error

line_length: 1000
type_name:
max_length:
warning: 100
error: 150

function_body_length:
warning: 50
error: 100

cyclomatic_complexity:
ignores_case_statements: true

identifier_name:
allowed_symbols: [_]

trailing_whitespace:
ignores_empty_lines: true
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"vknabel.vscode-swiftlint",
"sswg.swift-lang"
]
}
52 changes: 52 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"configurations": [
{
"type": "lldb",
"request": "launch",
"sourceLanguages": [
"swift"
],
"args": [],
"cwd": "${workspaceFolder:RHVoice-spm}",
"name": "Debug PackDataExecutable",
"program": "${workspaceFolder:RHVoice-spm}/.build/debug/PackDataExecutable",
"preLaunchTask": "swift: Build Debug PackDataExecutable"
},
{
"type": "lldb",
"request": "launch",
"sourceLanguages": [
"swift"
],
"args": [],
"cwd": "${workspaceFolder:RHVoice-spm}",
"name": "Release PackDataExecutable",
"program": "${workspaceFolder:RHVoice-spm}/.build/release/PackDataExecutable",
"preLaunchTask": "swift: Build Release PackDataExecutable"
},
{
"type": "lldb",
"request": "launch",
"sourceLanguages": [
"swift"
],
"args": [],
"cwd": "${workspaceFolder:RHVoice-spm}",
"name": "Debug RHVoiceSwiftSample",
"program": "${workspaceFolder:RHVoice-spm}/.build/debug/RHVoiceSwiftSample",
"preLaunchTask": "swift: Build Debug RHVoiceSwiftSample"
},
{
"type": "lldb",
"request": "launch",
"sourceLanguages": [
"swift"
],
"args": [],
"cwd": "${workspaceFolder:RHVoice-spm}",
"name": "Release RHVoiceSwiftSample",
"program": "${workspaceFolder:RHVoice-spm}/.build/release/RHVoiceSwiftSample",
"preLaunchTask": "swift: Build Release RHVoiceSwiftSample"
}
]
}
14 changes: 0 additions & 14 deletions Package.resolved

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// PackDataPluginExecutable.swift
//
//
//
// Created by Ihor Shevchuk on 16.07.2023.
// Copyright (C) 2022 Olga Yakovleva <olga@rhvoice.org>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// FileManager+TemporaryFolder.swift.swift
//
//
//
// Created by Ihor Shevchuk on 27.03.2024.
//
Expand Down
14 changes: 7 additions & 7 deletions Sources/RHVoiceSwift/RHSpeechSynthesisVoice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ import RHVoice
public struct RHSpeechSynthesisVoice {

public enum Gender {
case Female
case Male
case Unknown
case female
case male
case unknown

init(gender: RHVoice_voice_gender) {
switch gender {
case RHVoice_voice_gender_unknown:
self = .Unknown
self = .unknown
case RHVoice_voice_gender_female:
self = .Female
self = .female
case RHVoice_voice_gender_male:
self = .Male
self = .male
default:
self = .Unknown
self = .unknown
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/RHVoiceSwift/RHSpeechSynthesizer.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// RHSpeechSynthesizer.swift
//
//
//
// Created by Ihor Shevchuk on 09.03.2024.
//
Expand Down
10 changes: 5 additions & 5 deletions Sources/RHVoiceSwift/RHSpeechUtterance.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// RHSpeechUtterance.swift
//
//
//
// Created by Ihor Shevchuk on 10.03.2024.
//
Expand All @@ -10,9 +10,9 @@ import RHVoice

public struct RHSpeechUtterance {
public enum Quality {
case Min
case Standart
case Max
case min
case standart
case max
}

enum UtteranceError: Error {
Expand All @@ -30,7 +30,7 @@ public struct RHSpeechUtterance {
public var rate: Double = 1.0
public var volume: Double = 1.0
public var pitch: Double = 1.0
public var quality: Quality = .Standart
public var quality: Quality = .standart

var synthParams: RHVoice_synth_params {
get throws {
Expand Down
2 changes: 1 addition & 1 deletion Sources/RHVoiceSwift/RHVersionInfo.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// RHVersionInfo.swift
//
//
//
// Created by Ihor Shevchuk on 10.03.2024.
//
Expand Down

0 comments on commit 56ab02e

Please sign in to comment.