Commit Graph

1678 Commits

Author SHA1 Message Date
Marcelo Fabri bc79042e44 Fix false positive on unused_enumerated rule with complex variable bindings
Fix #1787
2017-08-21 11:47:32 +02:00
Marcelo Fabri f4690859b1 Merge pull request #1790 from marcelofabri/swift-version-cache
Invalidate cache when Swift version changes
2017-08-21 11:03:00 +02:00
Marcelo Fabri 1f611c326e Space 2017-08-21 00:24:09 +02:00
Marcelo Fabri 0a07628d8c Invalidate cache when Swift version changes 2017-08-21 00:19:04 +02:00
Marcelo Fabri 70488c9f0c Add SuperfluousDisableCommandRule 2017-08-20 23:27:48 +02:00
JP Simard 93b067ebdc refactor VerticalWhitespaceRule.validate(_:) to trigger a violation
regardless of whether or not the rule is disabled at that location.

Generally, rules shouldn't need to check if it's disabled when
triggering violations, since violations in disabled violations are
filtered out by the linter, which enables the ability to detect
superfluous disable commands that don't silence any violations.
2017-08-20 23:27:48 +02:00
JP Simard c57e8b081b modify let_var_whitespace's examples to pass 'disable command' tests 2017-08-20 23:27:48 +02: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 05eb60a67e Check if spec() is instance method 2017-08-18 12:09:42 +02:00
Marcelo Fabri 084850af7a Alternative approach without ASTRule 2017-08-18 12:09:20 +02:00
Ornithologist Coder 1908160d2b Update Rules file 2017-08-18 11:34:37 +02:00
Ornithologist Coder fe96e4139a Improve validation
* Apply 'cheap' validation earlier. It's not a call to a restrictive
  method, returns no violations.
* But if it it's a call to a restrictive method, then checks if the file
  containts a QuickSpec and if the call is within the bounds of the
  QuickSpec class.
2017-08-18 11:24:03 +02:00
Ornithologist Coder da98afcaf7 Apply code review changes 2017-08-18 11:24:03 +02:00
Ornithologist Coder 339e23070e Rename examples file and update headers 2017-08-18 11:24:03 +02:00
Ornithologist Coder c707adb0d8 Add quick_discouraged_call opt-in rule
Implements #1781 (Method calls and object initialization inside Quick
'describe' and 'context' blocks can be harmful)
2017-08-18 11:24:02 +02:00
Marcelo Fabri d4248e9b12 Fix tests on Linux 2017-08-17 20:36:44 +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
Ornithologist Coder 0a330f86b1 Apply code review changes 2017-08-16 18:29:43 +02:00
Ornithologist Coder d3a063e4e4 Rename method, update header and sort files and tests 2017-08-16 16:16:59 +02:00
Ornithologist Coder 641c4c2a88 Add another triggering example 2017-08-16 16:14:32 +02:00
Ornithologist Coder df6813f76a Add XCTestCase 2017-08-16 16:00:26 +02:00
Ornithologist Coder cf545c6892 Add quick_single_spec opt-in rule
Implements #1779 (Limit number of QuickSpecs in file to one).
2017-08-16 16:00:20 +02:00
Hossam Ghareeb ab8b3afb65 Improve vertical_whitespace reason and autocorrect when max_empty_lines > 1(#1774) 2017-08-14 11:17:14 +02:00
Ryan Booker c2445560e3 Support Optional<()> returns that use syntactic sugar, ()?, Void?, ()!,
and Void!
2017-08-10 21:35:20 +10:00
JP Simard 48aaff433f remove unused code in File+Cache.swift 2017-08-08 09:13:32 -07:00
JP Simard 5de980c042 make internal Region members public 2017-08-08 09:10:31 -07:00
JP Simard b829893b7d lower ACL of declarations that should be private 2017-08-08 09:10:31 -07:00
Ornithologist Coder 33175c9b6f Apply code review changes 2017-08-08 15:43:33 +02:00
Ornithologist Coder 147a4d2337 Make joined_default_parameter rule correctable
as described in #1757 and #1746.
2017-08-08 15:13:12 +02:00
Marcelo Fabri cb77820df1 Merge pull request #1755 from realm/mf-lint-non-swift-file
Support non Swift files in `--file` argument
2017-08-08 08:22:26 +02:00
JP Simard 82675aa0dc remove unused variable in ClosingBraceRule 2017-08-07 16:20:43 -07:00
Marcelo Fabri a300409798 Support non Swift files in --file argument
Fixes #1721.
2017-08-07 23:10:04 +02:00
Ornithologist Coder 3252673d3f Apply code review changes 2017-08-07 13:43:52 +02:00
Ornithologist Coder 99c93f1264 Move the violation mark to parameter offset 2017-08-03 13:58:37 +02:00
Ornithologist Coder da823f53d7 Add joined_default_parameter opt-in rule
to discourage explicit usage of the default separator. Implements #1093.
2017-08-03 13:41:00 +02:00
JP Simard 7f63bed10b fix triggering example formatting 2017-08-02 15:01:52 -07:00
JP Simard bcacf704ea simplify ForceUnwrappingRule's regular expressions 2017-08-02 14:56:44 -07:00
Otávio Lima fb7ffbab99 Fix force_unwrapping false positives for local variables
Fixes: #1710
2017-08-02 14:53:10 -07: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
JP Simard 80468f0886 change XCTFailMessageRule's ID to just 'xctfail_message'
since we don't include the '_rule' part of the name in its ID.
2017-08-02 12:08:22 -07:00
Ornithologist Coder 68c489069c Add xctfail_message_rule rule (#1370) 2017-08-02 14:29:54 +02:00
Marcelo Fabri e811218443 release 0.21.0 2017-08-02 00:18:04 +02:00
Marcelo Fabri 3dd4806acb Make discouraged_direct_init a default rule 2017-08-01 23:20:37 +02: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
Marcelo Fabri b139f2c2ee Merge pull request #1735 from marcelofabri/configurable-let_var_whitespace
Make let_var_whitespace configurable
2017-08-01 22:20:28 +02:00