From e2e41b11ec3398c81df5ae5bffe821c2784244a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihat=20Gu=CC=88ndu=CC=88z?= Date: Thu, 21 Mar 2024 17:37:55 +0100 Subject: [PATCH] Streamline README & remove SwiftLint config file --- .swiftlint.yml | 379 ------------------------------------------------- README.md | 12 +- 2 files changed, 6 insertions(+), 385 deletions(-) delete mode 100644 .swiftlint.yml diff --git a/.swiftlint.yml b/.swiftlint.yml deleted file mode 100644 index 8f7b341..0000000 --- a/.swiftlint.yml +++ /dev/null @@ -1,379 +0,0 @@ -# Basic Configuration -opt_in_rules: -- anyobject_protocol -- array_init -- attributes -- closure_end_indentation -- closure_spacing -- collection_alignment -- conditional_returns_on_newline -- contains_over_filter_count -- contains_over_filter_is_empty -- contains_over_first_not_nil -- contains_over_range_nil_comparison -- convenience_type -- empty_collection_literal -- empty_count -- empty_string -- empty_xctest_method -- explicit_init -- explicit_type_interface -- fallthrough -- fatal_error_message -- file_name -- file_name_no_space -- file_types_order -- first_where -- flatmap_over_map_reduce -- function_default_parameter_at_end -- identical_operands -- implicit_return -- implicitly_unwrapped_optional -- indentation_width -- joined_default_parameter -- last_where -- legacy_multiple -- legacy_random -- let_var_whitespace -- literal_expression_end_indentation -- lower_acl_than_parent -- missing_docs -- modifier_order -- multiline_arguments -- multiline_arguments_brackets -- multiline_literal_brackets -- multiline_parameters -- multiline_parameters_brackets -- nslocalizedstring_key -- number_separator -- object_literal -- operator_usage_whitespace -- optional_enum_case_matching -- overridden_super_call -- override_in_extension -- pattern_matching_keywords -- prefer_self_type_over_type_of_self -- private_action -- private_outlet -- prohibited_super_call -- reduce_into -- redundant_nil_coalescing -- redundant_type_annotation -- single_test_class -- sorted_first_last -- sorted_imports -- static_operator -- strong_iboutlet -- switch_case_on_newline -- toggle_bool -- trailing_closure -- type_contents_order -- unavailable_function -- unneeded_parentheses_in_closure_argument -- untyped_error_in_catch -- unused_declaration -- unused_import -- vertical_parameter_alignment_on_call -- vertical_whitespace_between_cases -- vertical_whitespace_closing_braces -- vertical_whitespace_opening_braces -- xct_specific_matcher -- yoda_condition - -included: -- Sources -- Tests - -excluded: -- Tests/LinuxMain.swift - -disabled_rules: - - todo - -# Rule Configurations -conditional_returns_on_newline: - if_only: true - -explicit_type_interface: - allow_redundancy: true - excluded: - - local - -file_name: - suffix_pattern: "Ext" - -identifier_name: - max_length: 60 - excluded: - - id - - db - - to - -indentation_width: - indentation_width: 2 - -line_length: 160 - -nesting: - type_level: 3 - -trailing_comma: - mandatory_comma: true - -trailing_whitespace: - ignores_comments: false - -# Custom Rules -custom_rules: - class_name_suffix_collection_view_controller: - included: ".*.swift" - regex: 'class +\w+(?]+>)? *: +\w+CollectionViewController' - name: "Class Name Suffix View Controller" - message: "All `CollectionViewController` subclasses should end on `CollectionViewController`." - severity: warning - class_name_suffix_table_view_controller: - included: ".*.swift" - regex: 'class +\w+(?]+>)? *: +\w+TableViewController' - name: "Class Name Suffix View Controller" - message: "All `TableViewController` subclasses should end on `TableViewController`." - severity: warning - class_name_suffix_view_controller: - included: ".*.swift" - regex: 'class +\w+(?]+>)? *: +\w+ViewController' - name: "Class Name Suffix View Controller" - message: "All `ViewController` subclasses should end on `ViewController`." - severity: warning - closure_params_parantheses: - included: ".*.swift" - regex: '\{\s*\((?!self)[^):]+\)\s*in' - name: "Unnecessary Closure Params Parantheses" - message: "Don't use parantheses around non-typed parameters in a closure." - severity: warning - comment_type_note: - included: ".*.swift" - regex: '// *(?:WORKAROUND|HACK|WARNING)[:\\s]' - name: "Comment Type NOTE" - message: "Use a '// NOTE:' comment instead." - severity: warning - comment_type_refactor: - included: ".*.swift" - regex: '// *(?:TODO|NOTE)[:\\s][^\n]*(?:refactor|REFACTOR|Refactor)' - name: "Comment Type REFACTOR" - message: "Use a '// REFACTOR:' comment instead." - severity: warning - comment_type_todo: - included: ".*.swift" - regex: '// *(?:BUG|MOCK|FIXME|RELEASE|TEST)[:\\s]' - name: "Comment Type TODO" - message: "Use a '// TODO:' comment instead." - severity: warning - controller_class_name_suffix: - included: ".*.swift" - regex: 'class +\w+(?\w+)(?:<[^\>]+>)? *\{.*static let `default`(?:: *\k)? *= *\k\(.*(?<=private) init\(' - name: "Singleton Default Private Init" - message: "Singletons with a `default` object (pseudo-singletons) should not declare init methods as private." - severity: warning - singleton_shared_final: - included: ".*.swift" - regex: '(?\w+)(?:<[^\>]+>)? *\{.*static let shared(?:: *\k)? *= *\k\(' - name: "Singleton Shared Final" - message: "Singletons with a single object (`shared`) should be marked as final." - severity: warning - singleton_shared_private_init: - included: ".*.swift" - regex: 'class +(?\w+)(?:<[^\>]+>)? *\{.*static let shared(?:: *\k)? *= *\k\(.*(?<= |\t|public|internal) init\(' - name: "Singleton Shared Private Init" - message: "Singletons with a single object (`shared`) should declare their init method(s) as private." - severity: warning - singleton_shared_single_object: - included: ".*.swift" - regex: 'class +(?\w+)(?:<[^\>]+>)? *\{.*(?:static let shared(?:: *\k)? *= *\k\(.*static let \w+(?:: *\k)? *= *\k\(|static let \w+(?:: *\k)? *= *\k\(.*static let shared(?:: *\k)? *= *\k\()' - name: "Singleton Shared Single Object" - message: "Singletons with a `shared` object (real Singletons) should not have other static let properties. Use `default` instead (if needed)." - severity: warning - switch_associated_value_style: - included: ".*.swift" - regex: 'case\s+[^\(][^\n]*(?:\(let |[^\)], let)' - name: "Switch Associated Value Style" - message: "Always put the `let` in front of case – even if only one associated value captured." - severity: warning - todo_format: - included: ".*.swift" - regex: '\/\/ TODO: [^\n]{0,14}\n|\/\/ TODO: \[\S{1,12}\]|\/\/ TODO: [^\[]|\/\/ TODO: \[.{13}[^\]]|\/\/ TODO: \[[^a-z]{2}|\/\/ TODO: \[.{2}[^_]|\/\/ TODO: \[.{7}[^-]|\/\/ TODO: \[.{10}[^-]' - name: "Todo Date" - message: "All TODOs should have a format with creator credentials & date of their creation documented like this: `// TODO: [cg_YYYY-MM-DD] `." - severity: warning - todo_uppercase: - included: ".*.swift" - regex: '\/\/ ?tODO|\/\/ ?ToDO|\/\/ ?TOdO|\/\/ ?TODo|\/\/ ?todo|\/\/ ?Todo|\/\/ ?ToDo|\/\/ ?toDo' - name: "Todo Uppercase" - message: "All TODOs should be all-uppercased like this: `// TODO: [cg_YYYY-MM-DD] `." - severity: warning - todo_whitespacing: - included: ".*.swift" - regex: '\/\/TODO|\/\/ TODO\s|\/\/ TODO:[^ ]|\/\/ TODO: |\/\/ TODO: \[[^\s]{0,10}\][^ ]' - name: "Todo Whitespace" - message: "All TODOs should exactly start like this (mind the whitespacing): `// TODO: [cg_YYYY-MM-DD] `." - severity: warning - tuple_index: - included: ".*.swift" - regex: '(\$\d|\w*[^\d \(\[\{])\.\d' - name: "Tuple Index" - message: "Prevent unwraping tuples by their index – define a typealias with named components instead." - severity: warning - unnecessary_case_break: - included: ".*.swift" - regex: '(case |default)(?:[^\n\}]+\n){2,}\s*break *\n|\n *\n *break(?:\n *\n|\n *\})' - name: "Unnecessary Case Break" - message: "Don't use break in switch cases – Swift breaks by default." - severity: warning - unnecessary_nil_assignment: - included: ".*.swift" - regex: 'var \S+\s*:\s*[^\s]+\?\s*=\s*nil' - name: "Unnecessary Nil Assignment" - message: "Don't assign nil as a value when defining an optional type – it's nil by default." - severity: warning - vertical_whitespaces_around_mark: - included: ".*.swift" - regex: '\/\/\s*MARK:[^\n]*(\n\n)|(\n\n\n)[ \t]*\/\/\s*MARK:|[^\s{]\n[^\n\/]*\/\/\s*MARK:' - name: "Vertical Whitespaces Around MARK:" - message: "Include a single vertical whitespace (empty line) before and none after MARK: comments." - severity: warning - view_controller_variable_naming: - included: ".*.swift" - regex: '(?:let|var) +\w*(?:vc|VC|Vc|viewC|viewController|ViewController) *=' - name: "View Controller Variable Naming" - message: "Always name your view controller variables with the suffix `ViewCtrl`." - severity: warning - whitespace_around_range_operators: - included: ".*.swift" - regex: '\w\.\.[<\.]\w' - name: "Whitespace around Range Operators" - message: "A range operator should be surrounded by a single whitespace." - severity: warning - whitespace_comment_start: - included: ".*.swift" - regex: '[^:#\]\}\)][^:#\]\}\)]\/\/[^\s\/]' - name: "Whitespace Comment Start" - message: "A comment should always start with a whitespace." - severity: warning diff --git a/README.md b/README.md index c1e1a0b..6f6a640 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,27 @@ -

+ [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FFlineDev%2FHandySwift%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/FlineDev/HandySwift) [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FFlineDev%2FHandySwift%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/FlineDev/HandySwift) # HandySwift -The goal of this library is to **provide handy features** that didn't make it to the Swift standard library (yet) due to many different reasons. +The goal of this library is to **provide handy features** that didn't make it to the Swift standard library (yet). -If you like this, please also checkout [HandySwiftUI](https://github.com/FlineDev/HandySwitUI) for handy UI features that should have been part of the SwiftUI framework in the first place. +Checkout [HandySwiftUI](https://github.com/FlineDev/HandySwitUI) for handy features that should have been part of SwiftUI. ## Documentation -These two guides show you how you can make the most of HandySwift: +Learn how you can make the most of HandySwift with these guides: * [Extensions Overview]() * [New Types Overview]() -The full documentation of HandySwift is available [here](https://swiftpackageindex.com/FlineDev/HandySwift/main/documentation/handyswift). +The full documentation is available [here](https://swiftpackageindex.com/FlineDev/HandySwift/main/documentation/handyswift). ## Showcase -I extracted this library from my Indie apps (leave a review to support me): +I extracted this library from these Indie apps (rate them with 5 stars to support me!): * [String Catalog Translator (Mac)](https://apps.apple.com/app/apple-store/id6476773066?pt=549314&ct=github.com&mt=8) * [CrossCraft: Custom Crosswords (iPhone, iPad, Mac, Vision)](https://apps.apple.com/app/apple-store/id6472669260?pt=549314&ct=github.com&mt=8)