Skip to content

Commit

Permalink
Standardize MARKs, add SwiftFormat settings for cohesion with SwiftLint
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtavis committed May 14, 2024
1 parent 12537ce commit 1db32af
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 24 deletions.
3 changes: 3 additions & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
disable_formatting_rules:

- trailingCommas
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ Emojis for the following are chosen based on [gitmoji](https://gitmoji.dev/).
- While loops were replaced by for loops in places where they were being used inappropriately ([#380](https://github.com/scribe-org/Scribe-iOS/issues/380)).
- The [Scribe-i18n](https://github.com/scribe-org/Scribe-i18n) directory has been added for future localization work.
- SQLite queries were refactored to extract the DB access logic into a common file ([#378](https://github.com/scribe-org/Scribe-iOS/issues/378)).
- A SwiftLint pull request workflow was added to the codebase to check style and other coding conventions ([#390](https://github.com/scribe-org/Scribe-iOS/issues/390)).
- Trailing commas were removed from the codebase ([#421](https://github.com/scribe-org/Scribe-iOS/issues/421)).
- SwiftFormat was configured to allow for the removal of trailing commas ([#421](https://github.com/scribe-org/Scribe-iOS/issues/421)).

# Scribe-iOS 2.3.0

Expand Down
2 changes: 1 addition & 1 deletion Keyboards/KeyboardsBase/InterfaceVariables.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import UIKit
// A proxy into which text is typed.
var proxy: UITextDocumentProxy!

// MARK: Display Variables
// MARK: - Display Variables

// Variables for the keyboard and its appearance.
var keyboard = [[String]]()
Expand Down
34 changes: 17 additions & 17 deletions Keyboards/KeyboardsBase/KeyboardViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class KeyboardViewController: UIInputViewController {
loadKeys()
}

// MARK: Display Activation Functions
// MARK: - Display Activation Functions

/// Function to load the keyboard interface into which keyboardView is instantiated.
func loadInterface() {
Expand Down Expand Up @@ -137,7 +137,7 @@ class KeyboardViewController: UIInputViewController {
btn.isUserInteractionEnabled = false
}

// MARK: Override UIInputViewController Functions
// MARK: - Override UIInputViewController Functions

/// Includes adding custom view sizing constraints.
override func updateViewConstraints() {
Expand Down Expand Up @@ -259,7 +259,7 @@ class KeyboardViewController: UIInputViewController {
}
}

// MARK: Scribe Command Elements
// MARK: - Scribe Command Elements

// Partitions for autocomplete and autosuggest
@IBOutlet var leftAutoPartition: UILabel!
Expand Down Expand Up @@ -961,7 +961,7 @@ class KeyboardViewController: UIInputViewController {
}
}

// MARK: Conjugation Variables and Functions
// MARK: - Conjugation Variables and Functions

// Note that we use "form" to describe both conjugations and declensions.
@IBOutlet var shiftFormsDisplayLeft: UIButton!
Expand Down Expand Up @@ -1231,20 +1231,20 @@ class KeyboardViewController: UIInputViewController {
case .disabled:
break
case .accusativePersonalSPS, .dativePersonalSPS, .genitivePersonalSPS,
.accusativePossessiveSPS, .dativePossessiveSPS, .genitivePossessiveSPS:
.accusativePossessiveSPS, .dativePossessiveSPS, .genitivePossessiveSPS:
formsDisplayDimensions = .view1x2
case .accusativePersonalTPS, .dativePersonalTPS, .genitivePersonalTPS,
.accusativePossessiveTPS, .dativePossessiveTPS, .genitivePossessiveTPS:
.accusativePossessiveTPS, .dativePossessiveTPS, .genitivePossessiveTPS:
formsDisplayDimensions = .view3x1
case .accusativePossessiveFPS, .accusativePossessiveSPSInformal, .accusativePossessiveSPSFormal,
.accusativePossessiveTPSMasculine, .accusativePossessiveTPSFeminine, .accusativePossessiveTPSNeutral,
.accusativePossessiveFPP, .accusativePossessiveSPP, .accusativePossessiveTPP,
.dativePossessiveFPS, .dativePossessiveSPSInformal, .dativePossessiveSPSFormal,
.dativePossessiveTPSMasculine, .dativePossessiveTPSFeminine, .dativePossessiveTPSNeutral,
.dativePossessiveFPP, .dativePossessiveSPP, .dativePossessiveTPP,
.genitivePossessiveFPS, .genitivePossessiveSPSInformal, .genitivePossessiveSPSFormal,
.genitivePossessiveTPSMasculine, .genitivePossessiveTPSFeminine, .genitivePossessiveTPSNeutral,
.genitivePossessiveFPP, .genitivePossessiveSPP, .genitivePossessiveTPP:
.accusativePossessiveTPSMasculine, .accusativePossessiveTPSFeminine, .accusativePossessiveTPSNeutral,
.accusativePossessiveFPP, .accusativePossessiveSPP, .accusativePossessiveTPP,
.dativePossessiveFPS, .dativePossessiveSPSInformal, .dativePossessiveSPSFormal,
.dativePossessiveTPSMasculine, .dativePossessiveTPSFeminine, .dativePossessiveTPSNeutral,
.dativePossessiveFPP, .dativePossessiveSPP, .dativePossessiveTPP,
.genitivePossessiveFPS, .genitivePossessiveSPSInformal, .genitivePossessiveSPSFormal,
.genitivePossessiveTPSMasculine, .genitivePossessiveTPSFeminine, .genitivePossessiveTPSNeutral,
.genitivePossessiveFPP, .genitivePossessiveSPP, .genitivePossessiveTPP:
formsDisplayDimensions = .view2x2
}
} else if
Expand Down Expand Up @@ -1858,7 +1858,7 @@ class KeyboardViewController: UIInputViewController {
}
}

// MARK: Load Keys
// MARK: - Load Keys

/// Loads the keys given the current constraints.
func loadKeys() {
Expand Down Expand Up @@ -2149,7 +2149,7 @@ class KeyboardViewController: UIInputViewController {
}
}

// MARK: Button Actions
// MARK: - Button Actions

/// Triggers actions based on the press of a key.
///
Expand Down Expand Up @@ -2656,7 +2656,7 @@ class KeyboardViewController: UIInputViewController {
}
}

// MARK: Key Press Functions
// MARK: - Key Press Functions

/// Auto-capitalization if the cursor is at the start of the proxy.
func autoCapAtStartOfProxy() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ var allColoredPrompts: [NSAttributedString] = []
let languagesWithCapitalizedNouns = ["German"]
let languagesWithCaseDependantOnPrepositions = ["German", "Russian"]

// MARK: Translate Variables
// MARK: - Translate Variables

var translateKeyLbl = ""
var translatePrompt = ""
Expand All @@ -103,7 +103,7 @@ var translatePromptAndPlaceholder = ""
var translatePromptAndColorPlaceholder = NSMutableAttributedString()
var wordToTranslate = ""

// MARK: Conjugate Variables
// MARK: - Conjugate Variables

var conjugateKeyLbl = ""
var conjugatePrompt = ""
Expand Down Expand Up @@ -171,7 +171,7 @@ var verbToDisplay = ""
var wordToDisplay = ""
var conjugationToDisplay = ""

// MARK: Plural Variables
// MARK: - Plural Variables

var pluralKeyLbl = ""
var pluralPrompt = ""
Expand Down
4 changes: 2 additions & 2 deletions Scribe/AboutTab/AboutViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ final class AboutViewController: BaseTableViewController {
}
}

// MARK: UITableViewDataSource
// MARK: - UITableViewDataSource

extension AboutViewController {
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
Expand All @@ -48,7 +48,7 @@ extension AboutViewController {
}
}

// MARK: UITableViewDelegate
// MARK: - UITableViewDelegate

extension AboutViewController {
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
Expand Down
4 changes: 3 additions & 1 deletion Scribe/InstallationTab/DownloadDataVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ import UIKit
// }
// }
//
//// MARK: UITableViewDelegate

// MARK: - UITableViewDelegate

//
///// Function implementation conforming to the UITableViewDelegate protocol.
// extension DownloadDataVC: UITableViewDelegate {}

0 comments on commit 1db32af

Please sign in to comment.