Commit Graph

1640 Commits

Author SHA1 Message Date
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
Marcelo Fabri c8fc1db78e Make let_var_whitespace configurable 2017-08-01 20:21:59 +02:00
Marcelo Fabri 20d4ef241d Merge pull request #1733 from realm/mf-allow-fileprivate-extensions
Allow fileprivate extensions in PrivateOverFilePrivateRule
2017-08-01 18:16:15 +00:00
Ornithologist Coder 1726573902 Merge branch 'master' into discourage_init 2017-08-01 19:58:19 +02:00
Ornithologist Coder a9cc8e573a More code review 2017-08-01 19:29:48 +02:00
Marcelo Fabri f822e1c781 Merge pull request #1703 from marcelofabri/custom-yml-loading
Customize YAML loading for configurations
2017-08-01 17:25:53 +00:00
Ornithologist Coder b717780da1 Apply code review changes 2017-08-01 19:18:36 +02:00
Marcelo Fabri e80cc565fa Allow fileprivate extensions in PrivateOverFilePrivateRule 2017-08-01 18:26:57 +02:00
Marcelo Fabri 5c13de8ddb Use configuration severity 2017-08-01 18:03:33 +02:00
Ornithologist Coder 13c7e6e1d6 Add discouraged_direct_init opt-in rule
Rule requested by @Noobish1 on issue #1306.
2017-08-01 17:23:39 +02:00
Marcelo Fabri 33ca7d71f7 Customize YAML loading for configurations
This enables:

1. Using environment variables inside a configuration (fixes #1512)
2. Treating reserved keywords as strings (`yes`, `no`, `on` and `off`) instead of booleans (fixes #1424)
2017-08-01 15:25:27 +02:00
Marcelo Fabri d79f642c43 Make file_header rule ignore doc comments.
Fixes #1719
2017-08-01 13:51:31 +02:00
Marcelo Fabri 1a6b214002 Add test and changelog entry for #1488
#1488 was fixed in #1726.

This adds a test to make sure we don’t introduce regressions in the future and also adds a changelog entry.
2017-07-30 17:10:32 +02:00
JP Simard 00a9021ed3 reuse existing Location type
rather than introduce a locally-scoped struct when a perfectly good
existing type will do.
2017-07-29 18:34:09 -07:00
JP Simard 224a8c8dc5 rewrite VerticalParameterAlignmentRule to be less fragile 2017-07-29 18:11:11 -07:00
Marcelo Fabri 556ad4eed3 Use non-capture grup 2017-07-29 21:44:31 +02:00
Marcelo Fabri 46cee2cf45 Merge pull request #1725 from Liquidsoul/fix/large-tuple
Fix false positive in `large_tuple` rule when using throwing closure
2017-07-29 21:42:27 +02:00
Liquidsoul f037eabda1 Fix false positive in large_tuple rule when using throwing closure 2017-07-29 18:32:04 +02:00
Marcelo Fabri b1dbc62afa Merge pull request #1717 from realm/mf-block-based-kvo-rule
Add block_based_kvo rule
2017-07-29 12:07:56 +02:00
Marcelo Fabri 60062186e2 Fix example in empty_enum_arguments rule
This was mistakenly introduced in 189e055.
2017-07-28 21:32:49 +02:00
Marcelo Fabri ae6c5fb8d7 Merge pull request #1723 from realm/bugfix-1722
Fix false positive in `empty_enum_arguments` rule when using wildcards and  `where` clauses
2017-07-28 17:47:49 +02:00
Marcelo Fabri 189e055e0a Fix false positive in empty_enum_arguments rule when using wildcards and where clauses
Fixes #1722
2017-07-28 16:56:08 +02:00
Marcelo Fabri a9de74f91a Add block_based_kvo rule
Fixes #1714.
2017-07-27 21:05:57 +02:00
Marcelo Fabri 7c5da2f316 Add four to SwiftVersion 2017-07-27 14:28:40 +02:00
Marcelo Fabri f6a28d9c33 Run tests against all rules 2017-07-26 10:20:02 +02: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 d6e7df2ee4 Merge pull request #1193 from marcelofabri/trailing-closure-rule
Trailing closure rule
2017-07-26 00:23:09 +02:00
JP Simard 0c5d331c8f fix typo in variable 2017-07-25 09:32:50 -07:00
Marcelo Fabri 354ec3c183 Fixes after rebase 2017-07-24 00:50:49 +02:00
Marcelo Fabri b13cf8f95e Use new Dictionary extension methods 2017-07-24 00:50:31 +02:00
Marcelo Fabri 8f748e41a9 Validate trailing closure with muted parameter name 2017-07-24 00:50:31 +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 04a10ec18a Don't trigger when there're more than 1 closure parameter 2017-07-24 00:50:31 +02:00
Marcelo Fabri a1f3646a9b Add trailing_closure rule
Fixes #54
2017-07-24 00:50:31 +02:00
Marcelo Fabri 45460f06ed Improve file_header rule description
Fixes #1492
2017-07-24 00:47:55 +02:00
Marcelo Fabri a8f70d519e Merge pull request #1702 from marcelofabri/filelengthrule-ignore-comments
Add option to ignore comment lines in file_length rule
2017-07-23 20:32:16 +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 d4e2f91f34 Small changes and refactoring 2017-07-23 00:16:32 +02:00
Samuel Susla 84860461cb Ignore comment lines in file length rule 2017-07-23 00:16:32 +02:00