Commit Graph

2129 Commits

Author SHA1 Message Date
Dalton Claybrook dfa92dc07d Add bridge to NSString to fix linux issue 2018-09-10 23:45:56 -04:00
Dalton Claybrook 81746c6507 Make collection alignment rule opt-in 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 a71bb4dd48 Add more triggering and non-triggering examples 2018-09-10 23:45:56 -04:00
Dalton Claybrook 0597df5b8c Add support for colon alignment 2018-09-10 23:45:56 -04:00
Dalton Claybrook 31995f916f Clean up collection alignment rule to mimic other alignment rules 2018-09-10 23:45:56 -04:00
Dalton Claybrook d8a043f84b Create CollectionAlignmentConfiguration 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
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 8d734366fb Remove unused private declarations (#2386) 2018-09-03 16:45:02 -07:00
Marcelo Fabri fad73d36f4 Use File.syntaxMap instead of making a request (#2384) 2018-09-03 10:39:11 -07:00
JP Simard e460c5ef9c Add Unused Import analyzer rule (#2381) 2018-09-02 14:45:02 -07:00
JP Simard dcc85fb0f3 Remove unused imports (#2382) 2018-09-02 14:09:04 -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
Marcelo Fabri be60504dad Enable identical_operands rule on the project 2018-08-30 23:12:44 -07:00
Marcelo Fabri 5bb483d72b Add identical_operands opt-in rule 2018-08-30 23:12:19 -07:00
Dalton Claybrook 0c20003179 Improve description strings for Toggle Bool rule 2018-08-30 17:10:58 -04:00
Dalton Claybrook 585b9ab950 Fix incorrect triggering markers 2018-08-30 15:55:52 -04: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
Marcelo Fabri 881978ea26 Fix crash on multiline_function_chains rule
Fixes #2360
2018-08-23 21:10:56 -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
Marcelo Fabri 32164501e1 Merge pull request #2339 from marcelofabri/multiple_closures_with_trailing_closure-performance
Improve performance of multiple_closures_with_trailing_closure
2018-08-08 09:37:38 -07:00
Marcelo Fabri 5b3145a448 Improve performance of multiple_closures_with_trailing_closure 2018-08-08 08:50:23 -07:00
Marcelo Fabri 30fe00890c Fix comma rule false positives on object literals
Fixes #2345
2018-08-08 08:47:17 -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
JP Simard 1f9a0017e6 Refactor a rule disable command 2018-08-06 14:26:17 -07:00
JP Simard 3961d6482b Organize rules by kind in Xcode project (#2341) 2018-08-05 18:54:05 -07:00
JP Simard ea8ef1435e Prevent changing the value of Lazy.value
this should only be set by running `computation()`
2018-08-05 11:17:35 -07:00
Marcelo Fabri a2b7b702dc Merge pull request #2337 from marcelofabri/improve-line-length-performance
Improve line_length rule performance
2018-08-05 00:32:43 -07:00
Marcelo Fabri 12aaa29e2c Merge pull request #2338 from marcelofabri/empty_parentheses_with_trailing_closure-swift4.2
Improve empty_parentheses_with_trailing_closure performance on Swift 4.2
2018-08-05 00:32:17 -07:00
Marcelo Fabri 07ec15679a Improve empty_parentheses_with_trailing_closure performance on Swift 4.2 2018-08-04 23:46:19 -07:00
Marcelo Fabri cd34f8bf9f Improve line_length rule performance
Don’t calculate swiftDeclarationKindsByLine and syntaxKindsByLine if it’s not needed:

- When there are no lines that would trigger a violation
- When no configuration parameter that needs that information is set (e.g. the default configuration)
2018-08-04 23:23:34 -07:00
Marcelo Fabri 1f2a84fa2b Use closure expression from SourceKit on multiple_closures_with_trailing_closure 2018-08-04 22:38:44 -07:00
Marcelo Fabri 12996ef1f5 release 0.27.0 2018-07-31 09:28:44 -07: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 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
Mike Ciesielka 044d9168d6 Disable "line_length" to make exception for console output of lengthy configuration name "only_enforce_after_first_closure_on_first_line" 2018-07-28 15:49:36 -04: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
Cihat Gündüz 33b7213dca Make explicit_type_interface rule compatible with redundant_type_annotation 2018-07-27 11:12:46 +02:00
Cihat Gündüz d616282892 Add failing test for false positive in rule explicit_type_interface 2018-07-27 11:12:46 +02:00