Skip to content

Commit

Permalink
#390 fix swiftlint.yml file name + fix minor linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtavis committed Apr 26, 2024
1 parent acb5b2c commit b8cef23
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 65 deletions.
30 changes: 0 additions & 30 deletions .swiftlint.yaml

This file was deleted.

30 changes: 30 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# SwiftLint Configuration File

disabled_rules:
# ERRORS IN PROJECT CURRENTLY
- cyclomatic_complexity
- identifier_name
- function_body_length
- force_cast
- force_try
- line_length
- file_length
- type_body_length
# WARNINGS IN PROJECT CURRENTLY
- trailing_comma
- todo
- orphaned_doc_comment
- opening_brace
- blanket_disable_command
- for_where
- trailing_whitespace
- vertical_whitespace
- void_function_in_ternary
- empty_enum_arguments
- closure_parameter_position

identifier_name:
min_length: 1
max_length:
warning: 40
error: 41
6 changes: 3 additions & 3 deletions Keyboards/KeyboardsBase/KeyboardViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -656,14 +656,14 @@ class KeyboardViewController: UIInputViewController {
allowUndo = false
firstCompletionIsHighlighted = false
// Highlight if the current prefix is the first autocompletion.
if (
if
currentPrefix == completionWords[0] && completionWords[1] != " "
)

// Note: Code for highlighting the word if it's the only option available - add when libraries are expanded.
// || (
// // Highlighting last remaining autocomplete.
// completionWords[0] != " " && completionWords[1] == " "
// )
// )
{
firstCompletionIsHighlighted = true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public enum PortugueseKeyboardConstants {
static let letterKeysPadExpanded = [
["~", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "delete"],
[SpecialKeys.indent, "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "[", "]", "\\"],
[SpecialKeys.capsLock, "a", "s", "d", "f", "g", "h", "j", "k", "l", ":", ";", "ç", "return"],
[SpecialKeys.capsLock, "a", "s", "d", "f", "g", "h", "j", "k", "l", ":", ";", "ç", "return"],
["shift", "'", "z", "x", "c", "v", "b", "n", "m", ",", ".", "/", "shift"],
["selectKeyboard", ".?123", "space", ".?123", "hideKeyboard"], // "microphone", "scribble"
]
Expand Down
6 changes: 2 additions & 4 deletions Scribe.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -726,8 +726,6 @@
D1CDEDDC2A85AE9D00098546 /* NBInterfaceVariables.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1CDED802A85A12400098546 /* NBInterfaceVariables.swift */; };
D1F0367227AAE12200CD7921 /* InterfaceVariables.swift in Sources */ = {isa = PBXBuildFile; fileRef = D190B2492741B31F00705659 /* InterfaceVariables.swift */; };
D1F0367327AAE1B400CD7921 /* CommandVariables.swift in Sources */ = {isa = PBXBuildFile; fileRef = D190B2462741B24F00705659 /* CommandVariables.swift */; };
EA536F182AF9B4CB00795DA3 /* DownloadDataTable.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA536F162AF9B4CB00795DA3 /* DownloadDataTable.swift */; };
EA536F192AF9B4CB00795DA3 /* DownloadDataVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA536F172AF9B4CB00795DA3 /* DownloadDataVC.swift */; };
ED2486F32B0B4E8C0038AE6A /* AboutTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED2486F12B0B4E8C0038AE6A /* AboutTableViewCell.swift */; };
ED2486F42B0B4E8C0038AE6A /* AboutTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = ED2486F22B0B4E8C0038AE6A /* AboutTableViewCell.xib */; };
EDB4601B2AF9FD8200BEA967 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = EDB4601A2AF9FD8200BEA967 /* Localizable.xcstrings */; };
Expand Down Expand Up @@ -894,6 +892,7 @@
D111E9B127AFE79500746F92 /* Translate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Translate.swift; sourceTree = "<group>"; };
D111E9B927AFE7B200746F92 /* Annotate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Annotate.swift; sourceTree = "<group>"; };
D1362A37274C040F00C00E48 /* PRIVACY.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = PRIVACY.txt; sourceTree = "<group>"; };
D155AD272BDC69260075B18C /* .swiftlint.yaml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .swiftlint.yaml; sourceTree = "<group>"; };
D156BC0629CCDBE8007E7362 /* DEPrivacyPolicy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DEPrivacyPolicy.swift; sourceTree = "<group>"; };
D156BC0729CCDBE8007E7362 /* DEAppText.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DEAppText.swift; sourceTree = "<group>"; };
D15E297E29E41B3B006B2C81 /* FRLanguageData.sqlite */ = {isa = PBXFileReference; lastKnownFileType = file; name = FRLanguageData.sqlite; path = Keyboards/LanguageKeyboards/French/FRLanguageData.sqlite; sourceTree = SOURCE_ROOT; };
Expand Down Expand Up @@ -978,8 +977,6 @@
D1D8B23B2AE4089C0070B817 /* Italian.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Italian.entitlements; sourceTree = "<group>"; };
D1D8B23C2AE408AC0070B817 /* German.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = German.entitlements; sourceTree = "<group>"; };
D1D8B23D2AE408C50070B817 /* French.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = French.entitlements; sourceTree = "<group>"; };
EA536F162AF9B4CB00795DA3 /* DownloadDataTable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownloadDataTable.swift; sourceTree = "<group>"; };
EA536F172AF9B4CB00795DA3 /* DownloadDataVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownloadDataVC.swift; sourceTree = "<group>"; };
ED2486F12B0B4E8C0038AE6A /* AboutTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutTableViewCell.swift; sourceTree = "<group>"; };
ED2486F22B0B4E8C0038AE6A /* AboutTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AboutTableViewCell.xib; sourceTree = "<group>"; };
EDB4601A2AF9FD8200BEA967 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1190,6 +1187,7 @@
D190B28F27426F4900705659 /* LICENSE.txt */,
D1362A37274C040F00C00E48 /* PRIVACY.txt */,
D190B29027426F4900705659 /* README.md */,
D155AD272BDC69260075B18C /* .swiftlint.yaml */,
38BD213122D5907E00C6795D /* Products */,
D1A3EEED28F8D3EA00896C65 /* Frameworks */,
);
Expand Down
32 changes: 22 additions & 10 deletions Scribe/InstallationTab/DownloadDataTable.swift
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
//
// DownloadDataTable.swift
// Scribe
//
// Created by Marek Viktor on 06/11/2023.
//
/**
* The data table for the Download data screen of the Scribe app.
*
* Copyright (C) 2023 Scribe
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

import Foundation

//struct DownloadDataTable {
// struct DownloadDataTable {
// static var downloadDataTable = [
// ParentTableCellModel(
// headingTitle: "Data updates",
Expand All @@ -18,9 +30,9 @@ import Foundation
// hasDynamicData: nil
// )
// ]
//}
// }
//
//enum InstallationDataTable {
// enum InstallationDataTable {
// static var installationDataTable = [
// ParentTableCellModel(
// headingTitle: "Download language data",
Expand All @@ -30,4 +42,4 @@ import Foundation
// hasDynamicData: nil
// )
// ]
//}
// }
36 changes: 23 additions & 13 deletions Scribe/InstallationTab/DownloadDataVC.swift
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
//
// ViewController.swift
// Scribe
//
// Created by Marek Viktor on 06/11/2023.
//
// The ViewController for the Download data screen of the Scribe app.
//
/**
* The ViewController for the Download data screen of the Scribe app.
*
* Copyright (C) 2023 Scribe
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

import UIKit

//class DownloadDataVC: UIViewController {
// class DownloadDataVC: UIViewController {
// @IBOutlet var outerTable: UITableView!
//
// let tableData = DownloadDataTable.downloadDataTable
Expand All @@ -33,10 +43,10 @@ import UIKit
// super.viewWillAppear(animated)
// navigationController?.setNavigationBarHidden(false, animated: animated)
// }
//}
// }
//
///// Function implementation conforming to the UITableViewDataSource protocol.
//extension DownloadDataVC: UITableViewDataSource {
// extension DownloadDataVC: UITableViewDataSource {
// func tableView(_: UITableView, numberOfRowsInSection _: Int) -> Int {
// return tableData.count
// }
Expand All @@ -51,9 +61,9 @@ import UIKit
//
// return cell
// }
//}
// }
//
//// MARK: UITableViewDelegate
//
///// Function implementation conforming to the UITableViewDelegate protocol.
//extension DownloadDataVC: UITableViewDelegate {}
// extension DownloadDataVC: UITableViewDelegate {}
13 changes: 10 additions & 3 deletions Scribe/ParentTableCellModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ struct ParentTableCellModel {
}

struct Section {

let sectionTitle: String
let imageString: String?
let hasToggle: Bool
Expand All @@ -36,11 +35,19 @@ struct Section {
let shortDescription: String?
let externalLink: Bool?

init(sectionTitle: String, imageString: String? = nil, hasToggle: Bool = false, hasNestedNavigation: Bool = false, sectionState: SectionState, shortDescription: String? = nil, externalLink: Bool? = false) {
init(
sectionTitle: String,
imageString: String? = nil,
hasToggle: Bool = false, h _: Bool = false,

sectionState: SectionState,
shortDescription: String? = nil,
externalLink: Bool? = false
) {
self.sectionTitle = sectionTitle
self.imageString = imageString
self.hasToggle = hasToggle
self.hasNestedNavigation = hasNestedNavigation
hasNestedNavigation = hasNestedNavigation
self.sectionState = sectionState
self.shortDescription = shortDescription
self.externalLink = externalLink
Expand Down
5 changes: 4 additions & 1 deletion Scribe/Views/BaseTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ class BaseTableViewController: UITableViewController {
super.viewDidLoad()

tableView.sectionHeaderHeight = sectionHeaderHeight
tableView.register(UINib(nibName: "InfoChildTableViewCell", bundle: nil), forCellReuseIdentifier: "InfoChildTableViewCell")
tableView.register(
UINib(nibName: "InfoChildTableViewCell", bundle: nil),
forCellReuseIdentifier: "InfoChildTableViewCell"
)
tableView.separatorInset = separatorInset
if let tabBarController = tabBarController as? SwipeableTabBarController {
tabBarController.isCyclingEnabled = true
Expand Down

0 comments on commit b8cef23

Please sign in to comment.