Commit Graph

677 Commits

Author SHA1 Message Date
Marcelo Fabri cf0c7b7b21 Use default Equatable and Hashable implementations 2018-11-19 09:51:12 -08:00
JP Simard 5901d3075f
Require Swift 4.2 (#2466)
This bumps the minimum version required to build SwiftLint to 4.2. The primary motivating factor to drop support for Swift 4.0-4.1.x is that SwiftLint now uses CryptoSwift, which requires 4.2.

* Add changelog entry

* Remove --allow-warnings flag from CocoaPods commands

* Update CryptoSwift to 0.13.0

* Migrate to Swift 4.2

* Remove CircleCI tests for Swift < 4.2

* Update English and Chinese README

Korean README doesn't yet have a version table like this.

* Update gems

* Add changelog entry for fixed compiler warnings

* Update CocoaPods to 1.6.0.beta.2

To work around https://github.com/CocoaPods/CocoaPods/issues/7708
2018-11-18 17:32:25 -08:00
Marcelo Fabri 83a2ca4be7
Merge pull request #2419 from yhkaplan/random
New Rule - Legacy Random
2018-10-13 22:58:50 -07:00
Joshua Kaplan 6eda1396d8 Rename random rule to legacy random rule 2018-10-06 12:02:21 +09:00
Timofey Solonin 3189d171c7 #2422 - Fix CI 2018-10-01 13:37:18 +03:00
Timofey Solonin 2cc4dca379 #2422 - Add CompilerProtocolInitRule violation unit test for ExpressibleByIntegerLiteral protocol 2018-10-01 12:34:01 +03:00
Timofey Solonin 5bf50c8920 #2422 - Specify which compiler protocol initialization rule was violated 2018-10-01 12:32:43 +03:00
Joshua Kaplan b173350969 Automatic changes to documentation, MasterRuleList, and tests 2018-09-30 14:55:29 +09:00
Joshua Kaplan 6cf052d0d8 Add tests 2018-09-27 00:22:41 +09:00
Marcelo Fabri bf85625ed8
Merge pull request #2396 from marcelofabri/static_operator
Add static_operator opt-in rule
2018-09-14 10:44:28 -07:00
Marcelo Fabri b92b236a5e Add static_operator opt-in rule
Fixes #2395
2018-09-11 09:34:10 -07:00
Marcelo Fabri dfb447490e Enable collection_alignment on SwiftLint 2018-09-11 09:31:54 -07:00
Dalton Claybrook 3b1fd5e857 Add collection alignment tests to the correct target and update rules 2018-09-10 23:45:56 -04:00
Dalton Claybrook 4e27bf9f87 Collection alignment rule is no longer an automatic testable 2018-09-10 23:45:56 -04:00
Dalton Claybrook 45b0881f1d Add Collection Alignment rule and implement basic left-alignment case 2018-09-10 23:45:56 -04:00
Marcelo Fabri c9f315a798
Merge pull request #2372 from marcelofabri/identical_operands
Add identical_operands opt-in rule
2018-09-09 20:47:49 -07:00
Marcelo Fabri b089769a40 Enable some opt-in rules 2018-09-08 20:25:45 -07:00
JP Simard 53d8a3aba9
Add UnusedPrivateDeclarationRule (#2385)
* Add UnusedPrivateDeclarationRule

* Temporarily disable UnusedPrivateDeclarationRule tests on Xcode 10

So we can merge UnusedPrivateDeclarationRule without having to wait
for CircleCI to update its Xcode 10 version.
2018-09-05 21:59:45 -07:00
JP Simard e460c5ef9c
Add Unused Import analyzer rule (#2381) 2018-09-02 14:45:02 -07:00
JP Simard 2bcea4b04d
Add ability for SwiftLint to lint files with full type-checked AST awareness (#2379)
* Add LintableFilesVisitor

* Move LintCommand logic into LintOrAnalyzeCommand

to prepare for the upcoming analyze command

* Add AnalyzeCommand (not fully implemented yet in SwiftLintFramework)

* Add analyzerRules configuration member

* Add AnalyzerRule protocol

* Pass compiler arguments to validate/correct

* Add requiresFileOnDisk member to RuleDescription

This will be used by AnalyzerRules because they need a file on disk
to pass in the compiler arguments to SourceKit.

* Exclusively run AnalyzerRules when the Linter has compiler arguments

* Enable testing AnalyzerRules in TestHelpers

* Add ExplicitSelfRule

* Update documentation

* Fix `analyze --autocorrect`

* Improve performance of CompilerArgumentsExtractor

* Fix lint command actually running analyze

* Move File operations in TestHelpers into a private extension

* Add analyzer column to rules command and markdown documentation

* Use a Set literal

* Make AnalyzerRule inherit from OptInRule

* Mention analyzer_rules in readme

* Mention that analyzer rules are slow
2018-09-02 00:13:27 -07:00
JP Simard 6799b06f1b
Refactor TestHelpers (#2378) 2018-09-01 13:52:02 -07:00
JP Simard 75ba96b2ad
Fix testEmojiReporter on Linux with Swift 4.2 (#2375) 2018-09-01 12:44:52 -07:00
Marcelo Fabri 5bb483d72b Add identical_operands opt-in rule 2018-08-30 23:12:19 -07:00
Dalton Claybrook 4ea785c993 Add ToggleBoolRule 2018-08-30 10:22:21 -04:00
Marcelo Fabri 53647b4e6e Add inert_defer rule
Fixes #2123
2018-08-26 03:10:16 -07:00
Marcelo Fabri 04b634cde7 Add `prohibited_interface_builder` opt-in rule
Fixes #2365
2018-08-25 22:53:15 -07:00
Yusuke Ohashi 2e55028053
update as per comments 2018-08-16 15:03:21 +09:00
Yusuke Ohashi a941b2f242
added SonarQube reporter. 2018-08-16 15:02:47 +09:00
Marcelo Fabri 5c9b6b9c62
Merge pull request #2342 from ornithocoder/closure_length
Adds closure_body_length opt-in rule
2018-08-09 07:55:49 -07:00
Marcelo Fabri 14f677e6bb Fix false positive on `file_name` rule when using nested types
Fixes #2325
2018-08-08 09:38:20 -07:00
Ornithologist Coder c4bf3dee10 Adds closure_body_length opt-in rule
because closure bodies should not span too many lines. Implements #52.
Requires Swift 4.2.
2018-08-07 00:13:50 +02:00
Marcelo Fabri 88f4c8be6f Minor changes after merging #2318 2018-07-30 00:12:02 -07:00
Marcelo Fabri f7f3f3dee5
Merge pull request #2318 from mattremmel/nef10_missing_docs
Added back 'missing_docs' (Nef10)
2018-07-30 00:05:05 -07:00
Marcelo Fabri 87c44108b9 Add missing tests to LinuxMain 2018-07-29 22:59:24 -07:00
Marcelo Fabri 6ea0a5c4a1
Merge pull request #2316 from realm/ks/exclude-glob
Add support for globs in excluded paths
2018-07-29 22:46:00 -07:00
Marcelo Fabri 0820cd2976
Merge pull request #2313 from Dschee/explicit-type-interface
Add option allow_redundancy to rule explicit_type_interface
2018-07-29 22:45:17 -07:00
Marcelo Fabri 744403cedb
Merge pull request #2281 from maciesielka/feature/allow-first-closure-multiline-args
add "allow_first_closure_on_same_line" configuration to "multiline_arguments"
2018-07-29 22:41:12 -07:00
Michael Ciesielka 7efce91996 Rename “allow_first_closure_on_same_line” configuration for “multiline_arguments” rule to “only_enforce_after_first_closure_on_first_line” to increase clarity. 2018-07-28 15:28:34 -04:00
Cihat Gündüz b4f960bd48 Add config option allow_redundancy 2018-07-27 11:12:46 +02:00
Keith Smiley 97dc3b69e5
Rename function 2018-07-26 10:21:13 -07:00
Keith Smiley b21307530c
Move glob to its own struct 2018-07-26 10:21:13 -07:00
Keith Smiley 63edaa9081
Move alias tests to new file 2018-07-26 10:21:13 -07:00
Keith Smiley a807d723e4
Add support for globs in excluded paths 2018-07-26 10:21:13 -07:00
Matthew Remmel 7668b90b7f Regenerated LinuxMain.swift using sourcery 2018-07-25 14:17:41 -04:00
Matthew Remmel b990eb94f8 Fixed incorrect conflict merge 2018-07-25 13:38:55 -04:00
Matthew Remmel 89adc4224c Patch created from Nef10 (https://github.com/Nef10/SwiftLint.git) missing_docs branch, to remove merge commits that were preventing merging the PR (https://github.com/realm/SwiftLint/pull/2172) 2018-07-25 11:34:53 -04:00
Keith Smiley 6eedf5d73c
Add private_only to prefixed_toplevel_constant (#2315)
* Add private_only to prefixed_toplevel_constant

This allows users to opt in to only validate top level constants have
the given prefix if the constant is private or fileprivate.
2018-07-24 12:38:01 -07:00
Marcelo Fabri 8a686dac2a
Merge pull request #2310 from Dschee/file-name
Add options `prefix_pattern` and `suffix_pattern` to `file_name` rule
2018-07-24 09:46:28 -07:00
Marcelo Fabri f3be82a41d Rename variable in tests 2018-07-24 09:43:42 -07:00
Cihat Gündüz 03c9e88f3d Add test cases for when both prefix_pattern and custom_pattern are given 2018-07-24 17:44:59 +02:00