Commit Graph

568 Commits

Author SHA1 Message Date
Marcelo Fabri 757b5fb94d Add weak_computed_property rule
Fixes #2596
2019-01-26 02:11:35 -08:00
Marcelo Fabri 6fadf80eae Add deployment_target rule
Fixes #2589
2019-01-24 21:42:11 -08:00
Marcelo Fabri b2d428a4e2 release 0.30.1 2019-01-23 11:08:50 -08:00
Marcelo Fabri ea4e13b9a8 Add nslocalizedstring_key opt-in rule 2019-01-22 23:54:04 -08:00
Marcelo Fabri d40fc8e452 release 0.30.0 2019-01-17 23:28:28 -08:00
Marcelo Fabri 26e531f771 Rename rule to UnusedSetterValueRule 2019-01-17 20:37:31 -08:00
Marcelo Fabri 105f8a8710 Add unused_setter_argument rule 2019-01-17 18:51:47 -08:00
Samuel Susla 90232d542e Add DuplicateImportsRule (#2004) 2019-01-17 15:42:29 -08:00
JP Simard 0328f83db1 release 0.29.4 2019-01-16 14:29:24 -08:00
Marcelo Fabri f8e42d81e0 Add strong_iboutlet opt-in rule
Fixes #2433
2019-01-13 20:53:12 -08:00
Kim de Vos b5c5701e90 Warn when disabling non existing rules (#2504)
* Added violations when trying to disable non valid rule

* Added violations when trying to disable non valid rule

* Add changelog enty for 'superfluous_disable_command' improvement

* Uses all rule identifiers when running nonValidSuperfluousCommandViolations

* Address feedback from jpsim

* Uses all rule identifiers when running nonValidSuperfluousCommandViolations

* Address more feedback from jpsim

* Added customRuleIdentifiers when verifying undefinedSuperfluousCommandViolations

* Catch all invalid disable commands in a region

Not just the first one.

* Rename test
2019-01-13 15:10:44 -08:00
JP Simard 0e01e07326 #2441 - Fix inaccessible custom rules in nested configurations (#2556)
* #2441 - Pass custom rules identifiers to the enableRules function to consider custom rules of a parent of a nested configuration

* #2441 - Add custom rules merge

* #2441 - Fix line length violation

* #2441 - Add nested configutaion mocks with custom rules

* #2441 - Add nested configurations tests for custom rules

* #2441 - Disable function body length check

* #2441 - Update changelog

* Move changelog to appropriate position

* Split up and refactor Configuration.init to avoid being too long

* Add tests to LinuxMain.swift

* Remove redundant protocol conformances

Hashable implies Equatable

* Fix typo in changelog entry and add another fixed issue URL
2019-01-13 15:07:27 -08:00
JP Simard bd0f78a501 release 0.29.3 2019-01-07 16:30:54 -08:00
Marcelo Fabri d863fc9fb7 Add unused_control_flow_label rule
Fixes #2227
2019-01-05 18:59:32 -08:00
Marcelo Fabri c17e269cee Add last_where opt-in rule 2018-12-25 01:34:42 -08:00
Ornithologist Coder 96c434e21a Adds xct_specific_matcher opt-in rule 2018-12-24 01:01:11 -08:00
JP Simard a21a8b3344 release 0.29.2 2018-12-23 20:32:25 -08:00
Kim de Vos d62e187b5c Add Legacy Hashing rule (#2496) 2018-12-05 15:43:39 -08:00
JP Simard 0e862ca9c4 Enable vertical whitespace rules in SwiftLint
and fix violations
2018-12-02 14:01:23 -08:00
Cihat Gündüz 89c88517e1 Vertical whitespace opening & closing braces (#2291)
* Add VerticalWhitespaceOpening/ClosingBraces rules with description

* Implement validate, correct & add rules to lists

* Fix minor issues & update docs

* Fix copy & paste issue

* Improve autocorrection + Cleanup triggering examples

* Update changelog with new rule entries

* Add more validation examples

* [CHANGELOG.md] Mark new rules as opt-in

* Point to exact location of violation + update tests

* Make rules severity configurable

* Fix issues after rebasing

* Fix issue with CHANGELOG.md

* Add more violating examples, improve pattern to catch more cases

* Move changelog entries to new version

* Fix issues after rebase

* Move Changelog entry to current master

* Fix failing tests

* Fixes after refactoring

* Fix changelog entry position

* Make range unicode-safe (as suggested by @jpsim)

* Share duplicate Dictionary extension code
2018-12-02 13:41:50 -08:00
JP Simard c3d23ea771 release 0.29.1 2018-11-29 14:28:21 -08:00
Kim de Vos bf97e08fa7 Exit immediately when linting with a version other than swift_version if defined (#2491) 2018-11-29 12:40:29 -08:00
Cihat Gündüz cf034c9dfb Multiline Brackets (#2302)
* Add new multiline_literal_brackets rule with examples

* Implement rule

* Add changelog entry

* Fix CHANGELOG and rule name

* Fix tests + Update stuff after rebasing

* Add more examples & fix whitespace issue

* Address feedback from @ornithocoder

* Add multiline rules for arguments and parameters

* Fix false positives in rule multiline_parameters_brackets

* Fix false positive for trailing closures in multiline_arguments_brackets

* Add nested examples to rule multiline_arguments_brackets

* Fix more false positives in multiline_arguments_brackets rule

* Use guard where appropriate instead of if

* Update generated artifacts after rebase

* Add CHANGELOG entry for all three new rules

* Move changelog entries to new version

* Fix changelog entries position

* Move new rules to correct subfolder

* Update Rules.md file contents

* Fixup changelog

* Refactor rules
2018-11-28 10:30:36 -08:00
Cihat Gündüz 9d47c3471c Vertical whitespace between cases (#2292) 2018-11-28 08:34:10 -08:00
dirtydanee c4e2a38643 Add "Redundant @objc Attribute" Rule (#2270) 2018-11-27 16:50:53 -08:00
JP Simard 8fc75e393b release 0.29.0 2018-11-27 13:31:15 -08:00
JP Simard a944808c8b Default column to 1 in XcodeReporter output (#2488) 2018-11-27 13:00:01 -08:00
JP Simard b64ead1a3c release 0.28.2 2018-11-27 10:55:50 -08:00
JP Simard d1109da326 Parallelize iterating over subpaths (#2475)
This has a very small performance improvement on multi-core machines
2018-11-21 22:38:05 -08:00
Norio Nomura ea171fbbf2 Add SWIFTLINT_DISABLE_SOURCEKIT environment variable (#2473)
This can be used for avoid "Test::Unit::AssertionFailedError" error in `libxpc.dylib` on calling `sourcekitd_send_request_sync` in sandbox environment.
2018-11-21 17:03:42 -08:00
Marcelo Fabri fb9d8df8a3 Add back MARK 2018-11-20 10:32:20 -08:00
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
JP Simard 4955c173a0 release 0.28.1 2018-11-18 15:41:26 -08:00
JP Simard 94dd8b4772 release 0.28.0 2018-11-13 22:41:00 -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
Joshua Kaplan b173350969 Automatic changes to documentation, MasterRuleList, and tests 2018-09-30 14:55:29 +09:00
Joshua Kaplan 71b6def313 Add random rule 2018-09-27 00:21:36 +09:00
Marcelo Fabri 1f121b1ef7 Enable static_operator opt-in rule in SwiftLint 2018-09-16 20:33:28 -07:00
Marcelo Fabri b92b236a5e Add static_operator opt-in rule
Fixes #2395
2018-09-11 09:34:10 -07: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 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 4ea785c993 Add ToggleBoolRule 2018-08-30 10:22:21 -04:00