Commit Graph

254 Commits

Author SHA1 Message Date
Marcelo Fabri e84100eed4 Remove SwiftExpressionKind.other 2017-10-05 14:33:32 -03:00
Marcelo Fabri 0be8c855d2 Move functions to properties and Sets instead of Arrays 2017-10-04 14:34:00 -07:00
JP Simard c57c47d66f Remove unnecessary Swift version differences 2017-10-04 13:49:40 -07:00
Marcelo Fabri ee02e0f8e5 Remove support for building with Swift 3.1 2017-10-04 13:48:17 -07:00
Marcelo Fabri 81f90e6326 Add custom rule to enforce using queuedFatalError 2017-10-01 20:05:46 -03: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 ffa4e8a3fb Workaround union not working on Linux on Swift 3.1 2017-10-01 00:45:52 -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 e24d847596 Prevent crash on Swift 3.x 2017-09-30 01:38:26 -03:00
Marcelo Fabri d21262d1bc Ignore SwiftLint commands in file_header rule
Fixes #1810
2017-09-30 00:29:23 -03:00
JP Simard 06781c7ddd Simplify CharacterSet+LinuxHack.swift 2017-09-17 17:28:32 -07:00
Marcelo Fabri de6809b40f Remove hack for SR-3485 when building with Swift 4 2017-09-16 13:23:49 -03:00
JP Simard 01e4831a7c Update for Swift 4 in Xcode 9 beta 6 and latest Linux snapshot 2017-09-10 13:48:37 -07:00
Marcelo Fabri 53380531ff Improve unneeded_parentheses_in_closure_argument 2017-08-29 16:43:56 -03:00
Marcelo Fabri 54f9c22c60 Fix existing violations 2017-08-26 10:05:56 -03:00
JP Simard 5c1c9389c7 produce an error when a 'disable' command doesn't silence any rules 2017-08-20 23:27:48 +02:00
Marcelo Fabri 843ca9c535 Use configuration rootDirectory 2017-08-17 19:59:23 +02:00
Marcelo Fabri ffd7be5919 Fix picking the wrong configuration with —path
Fixes #1744
2017-08-17 19:59:23 +02:00
JP Simard 48aaff433f remove unused code in File+Cache.swift 2017-08-08 09:13:32 -07:00
JP Simard b829893b7d lower ACL of declarations that should be private 2017-08-08 09:10:31 -07:00
Marcelo Fabri a300409798 Support non Swift files in --file argument
Fixes #1721.
2017-08-07 23:10:04 +02:00
JP Simard db95f5d3cd use explicit ACL keywords for HashableRule 2017-08-02 13:29:24 -07:00
Stéphane Copin 3ad4842bcd Small changes and refactoring based on github Feedback 2017-08-02 13:05:26 -07:00
Stéphane Copin 9f1f454cf9 Refactor the way Configuration objects are created with regards to rules 2017-08-02 13:05:26 -07:00
Stéphane Copin f5f63c9072 Update tests to reflect nested configuration changes 2017-08-02 13:05:26 -07:00
Stéphane Copin 97c1dcd0fa Add support for nested configuration
Original commit here: https://github.com/realm/SwiftLint/commit/9eef125245e43a8ff333d45abd13f9f0177d7258

Significant modifications made by @jpsim
2017-08-02 13:05:26 -07:00
Marcelo Fabri 70fc1a197d Ignore shebang in all rules
By making a creative use of regions.
Fixes #1294.
2017-07-26 00:24:23 +02:00
Marcelo Fabri 0bf1179c83 Validating trailing closure even if there's only one param 2017-07-24 00:50:31 +02:00
Marcelo Fabri 374731d92f Fix mark rule corrections generating invalid code in some cases
Apparently, we never invalidated the file cache when autocorrecting 😬
2017-07-23 02:08:15 +02:00
Marcelo Fabri c01f4bd19f Enable extension_access_modifier rule 2017-07-21 21:08:52 +02:00
JP Simard 41513a55d5 fix compilation with Swift 3.2 2017-07-17 15:37:08 -07:00
JP Simard 40bd4e7d4f move parsing functionality to Configuration+Parsing 2017-07-17 12:05:05 -07:00
JP Simard e6f95d5723 move merging functionality to Configuration+Merging 2017-07-17 12:05:04 -07:00
JP Simard 8f8e5d1fc2 move "lintable files" functionality to Configuration+LintableFiles 2017-07-17 11:45:32 -07:00
JP Simard 6b8d2ba28a move Configuration+Cache.swift into Extensions/ 2017-07-17 11:42:05 -07:00
JP Simard 7acacf6bdb update dependencies, mostly for SourceKitten 0.18 2017-07-12 10:11:27 -07:00
JP Simard 57d4dc7c52 change an empty #if body for #if ! 2017-07-10 15:56:02 -07:00
JP Simard e54dcae5b7 enable let_var_whitespace rule in SwiftLint itself
and refactor code in a few places to conform to the rule
2017-07-10 15:42:55 -07:00
Marcelo Fabri 561653bcb2 Use prefix(while:) instead of partitioned(by:) 2017-06-14 14:33:04 +02:00
Marcelo Fabri 441bece9da Add extension_access_modifier rule 2017-06-02 21:24:55 +02:00
Marcelo Fabri 32e38c96cf Add kinds(inByteRange:) 2017-05-25 04:55:47 +02:00
JP Simard 592537966c make Region & Command structs conform to Equatable 2017-05-24 11:33:39 -07:00
JP Simard bb50a4e8e5 fix overlapping commands causing incorrect Region generation
fixes #1388
2017-05-23 13:38:24 -07:00
JP Simard 201a74ef0b recursively call extractCallsToSuper(methodName:) 2017-05-23 10:26:13 -07:00
JP Simard 923f38c11b simplify FileManager.modificationDate(forFileAtPath:) impl 2017-05-18 13:59:24 -07:00
Víctor Pimentel 5ed010c9c0 Change LinterCache to use file modification dates instead of hashing files with a weak algorithm. 2017-05-18 13:39:05 -07:00
JP Simard 04824c9b51 move 'AccessControlLevel.swift' from 'Extensions' to 'Models' 2017-05-16 10:58:49 -07:00
Marcelo Fabri d73ee8d3d9 Remove Swift 2 support
Also removes `missing_docs` and `valid_docs` rules.

Fixes #1453.
2017-04-23 13:43:41 +02:00
Norio Nomura a3d6a4295d NSRegularExpression is added on Linux 2017-04-17 17:22:54 +09:00
Daniel Rodríguez Troitiño c29cf9a4d0 Avoid pattern matching false positives
The rule for unused optional binding was false triggering for pattern matching where the associated value was just an underscore. Additionally, pattern matching mixed with unused optional binding was not triggering in some cases.

New non triggering and triggering examples have been added for the failing cases, and new regular expressions are used to catch all the cases.

Modify the code in `File+SwiftLint` to expose full `NSTextCheckingResult` (and not just ranges) and rewire some pieces to use the new functions.

Fixes #1376
2017-04-06 14:16:12 -07:00