Commit Graph

132 Commits

Author SHA1 Message Date
Norio Nomura 2a0ac455bc 'flatMap' is deprecated: renamed to 'compactMap(_:)' 2018-04-08 13:28:09 +09:00
Cyril Lashkevich 10ba712748 Fix for crash on Linux on sources with surrogate characters
Because of the bug https://bugs.swift.org/browse/SR-5971 SwiftLint
crashes when linting on Linux files like https://github.com/xmartlabs/Eureka/blob/master/Example/Example/ViewController.swift
2018-03-17 19:51:24 +01:00
rounak 639522163f Improve console description for ExplicitTypeInterfaceConfiguration
Add more tests for ExplicitTypeInterface
2018-02-25 19:18:38 -08:00
rounak e515f43424 Add separate test files for ExplicitTypeInterfaceRule & Config
Respond to PR comments
2018-02-25 19:18:38 -08:00
Rounak 975bd7b86e Fix linter warnings 2018-02-25 19:18:38 -08:00
Rounak 2a7abcf542 Add new configuration for Explicit Type Interface Rule to allow exempting certain types of variables
Signed-off-by: Rounak <rounak91@gmail.com>
2018-02-25 19:18:38 -08:00
Donald Ritter 1deddf2334 Adds a new rule which allows for enums that conform to protocol to
require cases.
2017-12-22 13:08:51 -05:00
JP Simard 34f429b0a3 Fix caching on Linux
This has never worked for two reasons:

1. We've used dictionaries to represent cache descriptions, which
   don't guarantee stable ordering of keys across invocations.
   This is true both on Darwin and Linux, but in practice ordering
   varies significantly more on Linux.
2. Storing a `TimeInterval` value in a `[String: Any]` dictionary
   and retrieving it again will not be dynamically castable to
   `Double` or `TimeInterval` but will be castable to `Int`.
2017-10-26 12:23:13 -07:00
Marcelo Fabri 0be8c855d2 Move functions to properties and Sets instead of Arrays 2017-10-04 14:34:00 -07:00
Marcelo Fabri 05685785f2 Merge pull request #1864 from marcelofabri/improve-allowed-symbols
Fix false negatives when using allowed_symbols
2017-10-01 01:11:46 -03:00
Marcelo Fabri be341f90b9 Introduce queuedFatalError
`fatalError` prints the full path of the file, which leaks filesystem information from the machine that built the binary. Now that we release via CocoaPods, this is more critical.
2017-09-30 15:07:23 -03:00
Marcelo Fabri 06f9d4c0f7 Fix false negatives when using allowed_symbols 2017-09-30 00:50:30 -03:00
JP Simard b829893b7d lower ACL of declarations that should be private 2017-08-08 09:10:31 -07:00
Marcelo Fabri d916dbb60f Merge pull request #1731 from ornithocoder/discourage_init
Add discouraged_init opt-in rule that discourages direct initialization of certain types
2017-08-01 23:18:48 +02:00
Ornithologist Coder a9cc8e573a More code review 2017-08-01 19:29:48 +02:00
Ornithologist Coder b717780da1 Apply code review changes 2017-08-01 19:18:36 +02:00
Marcelo Fabri e80cc565fa Allow fileprivate extensions in PrivateOverFilePrivateRule 2017-08-01 18:26:57 +02:00
Ornithologist Coder 13c7e6e1d6 Add discouraged_direct_init opt-in rule
Rule requested by @Noobish1 on issue #1306.
2017-08-01 17:23:39 +02:00
Marcelo Fabri d4e2f91f34 Small changes and refactoring 2017-07-23 00:16:32 +02:00
Samuel Susla 84860461cb Ignore comment lines in file length rule 2017-07-23 00:16:32 +02:00
Marcelo Fabri c01f4bd19f Enable extension_access_modifier rule 2017-07-21 21:08:52 +02:00
Marcelo Fabri a4aeaedbe0 Add tests and improve behavior 2017-07-18 17:57:59 +02:00
Jamie Edge 04c487929e Add support for optional 'error' severity level in configurations. 2017-07-18 16:50:26 +02:00
JP Simard 42c8db92b1 fix a number of uncaught colon spacing violations 2017-07-10 22:57:13 -07:00
Marcelo Fabri e86763739f Move kind to RuleDescription 2017-07-02 15:50:16 +02:00
Marcelo Fabri 102bca6155 Use validates_start_with_lowercase key on NameConfiguration
Fixes #1626
2017-06-18 20:13:31 +02:00
Cihat Gündüz ad03a2f2d0 Add ObjectLiteralConfiguration with color/image options
This fixes #1587 by implementing the discussed option config.
2017-06-15 06:07:43 +02:00
JP Simard cea6f43f37 make PrivateUnitTestRule & its configuration conform to CacheDescriptionProvider 2017-05-19 09:30:09 -07:00
JP Simard 0c0952046c ensure deterministic consoleDescription & cacheDescription generation 2017-05-19 09:25:53 -07:00
JP Simard f639ae95f1 add CacheDescriptionProvider protocol
to provide more complete descriptions for cache invalidation
purposes.
2017-05-18 14:31:33 -07:00
Javier Hernández 9d31eaccda Rename option to validates_start_lowercase 2017-05-10 20:53:44 +01:00
Javier Hernández fe916c121f Add option to allow names to start with uppercase 2017-05-10 20:53:44 +01:00
Javier Hernández 93583f3153 Add option to exclude non alphanumeric characters 2017-05-10 20:53:42 +01:00
Marcelo Fabri db66e74ccd Merge pull request #1499 from marcelofabri/complexityConfigTypo
Fix `ignores_case_statements` key in `cyclomatic_complexity` description
2017-05-07 17:11:50 +02:00
Jeffrey Blagdon 2e3130048f Fix ignores_case_statements key in cyclomatic_complexity description
Fixes #1434.
2017-05-07 17:10:21 +02:00
Marcelo Fabri 6805c4a1e0 Merge pull request #1480 from marcelofabri/unused_optional_binding_rule_ignore_option
Unused optional binding rule ignore option
2017-05-07 17:03:15 +02:00
Marcelo Fabri 2282362989 Remove extra parenthesis on file header rule description 2017-05-04 21:37:34 +02:00
Сергей Галездинов 74e77e82bb Additional configuration for UnusedOptionalBindingRule 2017-05-01 14:59:00 +02:00
Nigel Flack 6321e24877 Adds support for excluded in custom rules 2017-04-14 15:14:45 +01:00
JP Simard 691d79f650 break out FileHeaderConfiguration.consoleDescription
to speed up type checking.

It took 18 seconds to type check on Homebrew's Jenkins job when
submitting 0.18.0: https://github.com/Homebrew/homebrew-core/pull/12161
2017-04-06 15:59:24 -07:00
Keith Smiley b410c9376a Update optional interpolated strings for Xcode 8.3 2017-04-06 13:37:49 -07:00
Marcelo Fabri e26710c0ad Merge pull request #1362 from SiarheiFedartsou/implicitly_unwrapped_optional_rule
Add `implicitly_unwrapped_optional` rule
2017-03-22 21:16:18 +01:00
Siarhei Fedartsou e6c718bdbd Fix operator in ColonConfiguration 2017-03-19 13:19:55 +03:00
Siarhei Fedartsou 2e579aaa6c Add configuration for implicitly_unwrapped_optional_rule, add triggering on complex types(AnyCollection<Int!> for ex.) 2017-03-19 00:27:13 +03:00
Siarhei Fedartsou fe8359a81d Add implicitly_unwrapped_optional rule 2017-03-18 00:01:32 +03:00
JP Simard 1d27ae1549 Merge pull request #1299 from mlwelles/cyclomatic_complexity_ignores_case_statments
Cyclomatic complexity ignores case statments
2017-03-10 15:19:46 -08:00
t_hayashi 6872018862 Add configuration for NestingRule 2017-03-04 01:14:30 +09:00
Michael Welles a6175faad0 made adjustments per PR feedback, added tests for cyclomatic complexity configuration class 2017-02-15 11:20:17 -05:00
Michael Welles d561b1acf6 Merge branch 'master' of github.com:realm/SwiftLint into cyclomatic_complexity_ignores_case_statments 2017-02-10 11:17:37 -05:00
JP Simard a10156b5eb update LineLengthConfiguration.consoleDescription after #1264 2017-02-09 14:42:10 -08:00