diff --git a/.swiftlint.yaml b/.swiftlint.yaml deleted file mode 100644 index d55a1a1a..00000000 --- a/.swiftlint.yaml +++ /dev/null @@ -1,30 +0,0 @@ -# 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 (excluding those already listed as errors) -# - 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 diff --git a/.swiftlint.yml b/.swiftlint.yml new file mode 100644 index 00000000..778bf12e --- /dev/null +++ b/.swiftlint.yml @@ -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 diff --git a/Keyboards/KeyboardsBase/KeyboardViewController.swift b/Keyboards/KeyboardsBase/KeyboardViewController.swift index 5eb4fa3a..eb28a8a5 100644 --- a/Keyboards/KeyboardsBase/KeyboardViewController.swift +++ b/Keyboards/KeyboardsBase/KeyboardViewController.swift @@ -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 } diff --git a/Keyboards/LanguageKeyboards/Portuguese/PTInterfaceVariables.swift b/Keyboards/LanguageKeyboards/Portuguese/PTInterfaceVariables.swift index c11a7447..b722591c 100644 --- a/Keyboards/LanguageKeyboards/Portuguese/PTInterfaceVariables.swift +++ b/Keyboards/LanguageKeyboards/Portuguese/PTInterfaceVariables.swift @@ -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" ] diff --git a/Scribe.xcodeproj/project.pbxproj b/Scribe.xcodeproj/project.pbxproj index dc4f98c7..fe86190e 100644 --- a/Scribe.xcodeproj/project.pbxproj +++ b/Scribe.xcodeproj/project.pbxproj @@ -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 */; }; @@ -894,6 +892,7 @@ D111E9B127AFE79500746F92 /* Translate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Translate.swift; sourceTree = ""; }; D111E9B927AFE7B200746F92 /* Annotate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Annotate.swift; sourceTree = ""; }; D1362A37274C040F00C00E48 /* PRIVACY.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = PRIVACY.txt; sourceTree = ""; }; + D155AD272BDC69260075B18C /* .swiftlint.yaml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .swiftlint.yaml; sourceTree = ""; }; D156BC0629CCDBE8007E7362 /* DEPrivacyPolicy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DEPrivacyPolicy.swift; sourceTree = ""; }; D156BC0729CCDBE8007E7362 /* DEAppText.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DEAppText.swift; sourceTree = ""; }; D15E297E29E41B3B006B2C81 /* FRLanguageData.sqlite */ = {isa = PBXFileReference; lastKnownFileType = file; name = FRLanguageData.sqlite; path = Keyboards/LanguageKeyboards/French/FRLanguageData.sqlite; sourceTree = SOURCE_ROOT; }; @@ -978,8 +977,6 @@ D1D8B23B2AE4089C0070B817 /* Italian.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Italian.entitlements; sourceTree = ""; }; D1D8B23C2AE408AC0070B817 /* German.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = German.entitlements; sourceTree = ""; }; D1D8B23D2AE408C50070B817 /* French.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = French.entitlements; sourceTree = ""; }; - EA536F162AF9B4CB00795DA3 /* DownloadDataTable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownloadDataTable.swift; sourceTree = ""; }; - EA536F172AF9B4CB00795DA3 /* DownloadDataVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DownloadDataVC.swift; sourceTree = ""; }; ED2486F12B0B4E8C0038AE6A /* AboutTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutTableViewCell.swift; sourceTree = ""; }; ED2486F22B0B4E8C0038AE6A /* AboutTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AboutTableViewCell.xib; sourceTree = ""; }; EDB4601A2AF9FD8200BEA967 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = ""; }; @@ -1190,6 +1187,7 @@ D190B28F27426F4900705659 /* LICENSE.txt */, D1362A37274C040F00C00E48 /* PRIVACY.txt */, D190B29027426F4900705659 /* README.md */, + D155AD272BDC69260075B18C /* .swiftlint.yaml */, 38BD213122D5907E00C6795D /* Products */, D1A3EEED28F8D3EA00896C65 /* Frameworks */, ); diff --git a/Scribe/InstallationTab/DownloadDataTable.swift b/Scribe/InstallationTab/DownloadDataTable.swift index 8aa4f95b..b157d8fa 100644 --- a/Scribe/InstallationTab/DownloadDataTable.swift +++ b/Scribe/InstallationTab/DownloadDataTable.swift @@ -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 . + */ import Foundation -//struct DownloadDataTable { +// struct DownloadDataTable { // static var downloadDataTable = [ // ParentTableCellModel( // headingTitle: "Data updates", @@ -18,9 +30,9 @@ import Foundation // hasDynamicData: nil // ) // ] -//} +// } // -//enum InstallationDataTable { +// enum InstallationDataTable { // static var installationDataTable = [ // ParentTableCellModel( // headingTitle: "Download language data", @@ -30,4 +42,4 @@ import Foundation // hasDynamicData: nil // ) // ] -//} +// } diff --git a/Scribe/InstallationTab/DownloadDataVC.swift b/Scribe/InstallationTab/DownloadDataVC.swift index 44ec9a84..a1b040bd 100644 --- a/Scribe/InstallationTab/DownloadDataVC.swift +++ b/Scribe/InstallationTab/DownloadDataVC.swift @@ -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 . + */ import UIKit -//class DownloadDataVC: UIViewController { +// class DownloadDataVC: UIViewController { // @IBOutlet var outerTable: UITableView! // // let tableData = DownloadDataTable.downloadDataTable @@ -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 // } @@ -51,9 +61,9 @@ import UIKit // // return cell // } -//} +// } // //// MARK: UITableViewDelegate // ///// Function implementation conforming to the UITableViewDelegate protocol. -//extension DownloadDataVC: UITableViewDelegate {} +// extension DownloadDataVC: UITableViewDelegate {} diff --git a/Scribe/ParentTableCellModel.swift b/Scribe/ParentTableCellModel.swift index af0c5ba1..06be9d98 100644 --- a/Scribe/ParentTableCellModel.swift +++ b/Scribe/ParentTableCellModel.swift @@ -27,7 +27,6 @@ struct ParentTableCellModel { } struct Section { - let sectionTitle: String let imageString: String? let hasToggle: Bool @@ -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 diff --git a/Scribe/Views/BaseTableViewController.swift b/Scribe/Views/BaseTableViewController.swift index 9ffefb9c..a42f2f03 100644 --- a/Scribe/Views/BaseTableViewController.swift +++ b/Scribe/Views/BaseTableViewController.swift @@ -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