Commit Graph

2198 Commits

Author SHA1 Message Date
JP Simard 84bfdca774 Enable File Name rule for SwiftLint & fix violations 2018-05-11 22:17:40 -07:00
JP Simard 24ec44d288 Add file_name opt-in rule
validating that file names contain the name of a
type or extension declared in the file (if any).
2018-05-11 22:17:39 -07:00
JP Simard 62a3b707fa Merge pull request #2185 from marcelofabri/default-params-end
Add function_default_parameter_at_end rule
2018-05-11 20:42:08 -07:00
JP Simard cfd43e3231 Merge pull request #2198 from erichoracek/eh—literal-expression-end-indentation-autocorrect
Make literal end indentation rule correctable
2018-05-11 20:41:47 -07:00
Marcelo Fabri cadf6112fc Merge pull request #2200 from marcelofabri/bugfix-2187
Fix false negatives in `implicit_return`
2018-05-11 13:17:53 -07:00
Marcelo Fabri 5de844f64d Fix false negatives in implicit_return
Fixes #2187
2018-05-11 10:12:57 -07:00
JP Simard add9b53ea3 Merge branch 'master' into master 2018-05-11 10:11:27 -07:00
Eric Horacek c15e668a57 Fix accidental exponential linting 2018-05-11 09:49:30 -07:00
Eric Horacek 2184b526ef Test cascading corrections 2018-05-11 09:49:30 -07:00
Eric Horacek e259629b95 Make literal end indentation rule correctable
Follows the same ideas in #2192
2018-05-11 09:49:30 -07:00
Marcelo Fabri 588bed83e6 Add function_default_parameter_at_end rule 2018-05-11 09:18:30 -07:00
Marcelo Fabri 50f49ee7b7 Merge pull request #2189 from ornithocoder/empty_xctests
Add empty_xctest_method opt-in rule
2018-05-11 09:15:22 -07:00
Marcelo Fabri 1cec0ff8fb Merge pull request #2199 from marcelofabri/bugfix-2188
Fix `unneeded_parentheses_in_closure_argument` false positives
2018-05-11 08:49:05 -07:00
Ornithologist Coder d61fd40a95 Use substructure to check if method is empty 2018-05-11 10:10:54 +02:00
Marcelo Fabri e5600cf587 Fixing #1897 2018-05-10 23:25:03 -07:00
Marcelo Fabri c716a7d68c Fix unneeded_parentheses_in_closure_argument false positives
Fixes #2188
2018-05-10 23:20:30 -07:00
Eric Horacek f18571effc Fix operator usage spacing nested generics false positive
This was being corrected to:
```
let model = Generic<Container<Button>, NSAttributedString > (
```
2018-05-10 16:09:15 -07:00
Ornithologist Coder 7cef22b968 Check if the method doesn't have any parameters 2018-05-11 00:11:31 +02:00
Varun P M 794160a8d2 Added ignores_default_parameters when calculating parameter count 2018-05-10 17:40:30 +05:30
Ornithologist Coder 5eea1d10ba Add empty_xctest_method opt-in rule 2018-05-10 14:05:42 +02:00
Eric Horacek aaf0b9a5d7 compactMap, whitespace 2018-05-08 21:54:04 -07:00
Eric Horacek d21b787980 Make closure end indentation rule correctable 2018-05-08 21:00:19 -07:00
Marcelo Fabri dc93d1de82 Fix false positive in redundant_set_access_control
Fixes #2182
2018-05-06 21:42:00 -07:00
Eric Horacek 326c53cc56 Only validate if first argument starts with a newline 2018-05-06 15:07:01 -07:00
Eric Horacek b9a2862d12 Include named closure parameters in closure end indentation
Fixes #2121
2018-05-06 15:07:01 -07:00
JP Simard 4bf69d7d84 Remove newlines from switch case reason 2018-05-06 14:33:47 -07:00
freak4pc 1ba963c443 Address PR feedback from @jpsim 2018-05-07 00:06:00 +03:00
freak4pc 3738512511 Added indented triggering cases 2018-05-06 23:34:14 +03:00
freak4pc 4d3a1173b6 Apply correct severity form configuration 2018-05-06 23:34:14 +03:00
freak4pc d429ad4358 Get rid of duplicated RuleConfiguration and use reason instead 2018-05-06 23:34:14 +03:00
freak4pc 62d0dd14ca Remove headers 2018-05-06 23:34:14 +03:00
freak4pc 7809ac731a Add specific violation reason for switch_case_alignment based on configuration. 2018-05-06 23:34:14 +03:00
freak4pc fbdba25636 Further abstracted non-triggering and triggering examples based on config.
Also updated ACL to be internal for rule Examples.
2018-05-06 23:34:14 +03:00
freak4pc 8e0202cfc8 Added violation marker and fixed tests 2018-05-06 23:34:14 +03:00
freak4pc ca47802fd4 Add tests for indented and non-indented cases (still failing WIP) 2018-05-06 23:34:14 +03:00
freak4pc 9cc41ac9cf Switched to indented_cases bool style 2018-05-06 23:34:14 +03:00
freak4pc e8b64b4a72 Add indentation to SwitchCaseAlignmentRule 2018-05-06 23:34:13 +03:00
JP Simard e89e56b99a Fix TrailingCommaRuleTests for Swift < 4.1 2018-05-06 13:11:17 -07:00
JP Simard c5de0f481f Refactor LineLengthConfiguration.apply(configuration:)
to avoid high cyclomatic complexity
2018-05-06 10:54:46 -07:00
Michael Gray ac9b5348e1 Added "ignores_interpolated_strings" option to line_length (default value is false) 2018-05-06 10:41:15 -07:00
JP Simard 2eed8d469d Apply Marcelo Fabri's patch 2018-05-06 10:33:33 -07:00
John Szumski 49916465ec Prevent discouraged_optional_collection from uniquing values since nested collections will trigger multiple times at the start of the first collection. 2018-05-06 10:33:33 -07:00
John Szumski d8283a40ef Added new trigger for trailing_comma. 2018-05-06 10:33:33 -07:00
John Szumski 4649df9770 Added violationsAreUnique checks to existing uses of unique. 2018-05-06 10:33:33 -07:00
John Szumski b03b4f0891 Added a new computed property that identifies whether a rule should treat multiple violations at the same location as only one violation. 2018-05-06 10:33:33 -07:00
John Szumski d2d6c8f678 Improved autocorrect behavior of multiple rules when preprocessor macros are present.
EmptyEnumArgumentsRule: no change needed
EmptyParenthesesWithTrailingClosureRule: fixed with .unique
ExplicitInitRule: fixed with .unique
JoinedDefaultParameterRule: fixed with .unique
RedundantOptionalInitializationRule: fixed with .unique
UnusedClosureParameterRule: fixed with .unique
2018-05-06 10:33:32 -07:00
JP Simard cd7f0c1fd9 Merge pull request #2164 from realm/ks/acl-rule
Remove extensions from LowerACLThanBodyRule
2018-05-06 10:32:39 -07:00
JP Simard b88133459e Re-add Comparable conformance to AccessControlLevel
since this was publicly added and is generally useful to consumers of
SwiftLintFramework.
2018-05-06 10:07:29 -07:00
JP Simard 6f0318e1b3 Another attempt to fix compiler issues with CocoaPods 2018-05-05 16:57:13 -07:00
JP Simard d7c27bd80e Fix compilation error in some Swift versions 2018-05-05 16:36:57 -07:00