From c290ebe427ef218d91344c1b7cf162af4e00fa72 Mon Sep 17 00:00:00 2001 From: Danny Moesch Date: Sat, 4 Jul 2020 23:36:27 +0200 Subject: [PATCH] Enable SwiftLint rule 'legacy_multiple' and fix all violations --- .swiftlint.yml | 2 +- passKit/Passwords/PasswordGenerator.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.swiftlint.yml b/.swiftlint.yml index 779be99..b2b1cc9 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -86,7 +86,7 @@ whitelist_rules: - legacy_constant - legacy_constructor - legacy_hashing -# - legacy_multiple + - legacy_multiple - legacy_nsgeometry_functions - legacy_random # - let_var_whitespace diff --git a/passKit/Passwords/PasswordGenerator.swift b/passKit/Passwords/PasswordGenerator.swift index 51b4d7e..8b812d0 100644 --- a/passKit/Passwords/PasswordGenerator.swift +++ b/passKit/Passwords/PasswordGenerator.swift @@ -76,7 +76,7 @@ public struct PasswordGenerator: Codable { guard flavor == .random, groups > 0, groups < length else { return false } - return (length + 1) % groups == 0 + return (length + 1).isMultiple(of: groups) } private func generateRandom() -> String {