Commit Graph

496 Commits

Author SHA1 Message Date
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
Marcelo Fabri 588bed83e6 Add function_default_parameter_at_end rule 2018-05-11 09:18:30 -07:00
Ornithologist Coder 5eea1d10ba Add empty_xctest_method opt-in rule 2018-05-10 14:05:42 +02:00
freak4pc 62d0dd14ca Remove headers 2018-05-06 23:34:14 +03:00
freak4pc 8e0202cfc8 Added violation marker and fixed tests 2018-05-06 23:34:14 +03:00
JP Simard 22a6187553 Merge branch 'master' into attibute_and_modifier_order
* master:
  Remove all file headers
  Make fallthrough rule opt-in
  Update the swift file and run the unit tests
  Fix a typo
2018-05-05 15:25:43 -07:00
JP Simard b83e0991b9 Remove all file headers
The MIT license doesn't require that all files be prepended with this
licensing or copyright information. Realm confirmed that they're ok with this
change. This will enable some companies to contribute to SwiftLint and the
date & authorship information will remain accessible via git source control.
2018-05-04 13:42:02 -07:00
Daniel Metzing 61259692ed Removing s from rule name 2018-04-27 08:59:02 +02:00
Daniel Metzing b2bb9d6c89 Merge remote-tracking branch 'upstream/master' into upstream_master 2018-04-26 15:10:14 +02:00
Daniel Metzing 5283598794 Merge remote-tracking branch 'upstream/master' into upstream_master 2018-04-25 12:43:06 +02:00
Marcelo Fabri 428379ce8f Add unavailable_function 2018-04-24 09:29:53 -07:00
Marcelo Fabri b338918b45 Merge pull request #2036 from marcelofabri/redudant-acl-set
[Swift 4.1] Add redundant_set_access_control rule
2018-04-24 09:19:53 -07:00
JP Simard fbeaaeb972 Use Sequence.reduce(into:) when possible 2018-04-22 20:46:46 -07:00
Daniel Metzing 1ec1fef998 Fixing project file after merge 2018-04-10 23:18:46 +02:00
Daniel Metzing cf64c0873b Merge branch 'attibute_and_modifier_order' into upstream_master
# Conflicts:
#	Cartfile
#	Cartfile.private
#	Cartfile.resolved
#	Carthage/Checkouts/SourceKitten
#	Package.resolved
#	Package.swift
#	Rules.md
#	Source/SwiftLintFramework/Extensions/Configuration+LintableFiles.swift
#	Source/SwiftLintFramework/Extensions/Dictionary+SwiftLint.swift
#	Source/SwiftLintFramework/Models/SwiftVersion.swift
#	Source/SwiftLintFramework/Rules/ModifiersOrderRule.swift
#	Source/SwiftLintFramework/Rules/RuleConfigurations/ModifiersOrderConfiguration.swift
#	SwiftLint.xcodeproj/project.pbxproj
#	Tests/SwiftLintFrameworkTests/LinterCacheTests.swift
#	Tests/SwiftLintFrameworkTests/ModifiersOrderTests.swift
#	circle.yml
2018-04-10 23:04:11 +02:00
Daniel Metzing c68a28dba5 Adding rule 2018-04-10 22:52:16 +02:00
Marcelo Fabri 1a9a4f7516 Add redundant_set_access_control rule
Fixes #1869
2018-04-08 21:54:50 -07:00
Marcelo Fabri 5231f6c9a5 Support min Swift version in Rule description 2018-04-08 21:52:45 -07:00
JP Simard 4fddef5ac1 release 0.25.1 2018-04-08 11:11:28 -07:00
JP Simard ec7f643475 Run 'make sourcery' 2018-04-08 10:48:27 -07:00
JP Simard 7070c3beac Merge pull request #2136 from realm/ks/lower-acl
Add LowerACLThanBodyRule
2018-04-08 10:44:44 -07:00
Norio Nomura 133cef8df1 ObjCBool is no longer implicitly converted to Bool on Linux 2018-04-08 13:28:09 +09:00
Norio Nomura 2a0ac455bc 'flatMap' is deprecated: renamed to 'compactMap(_:)' 2018-04-08 13:28:09 +09:00
Norio Nomura 7d0f239e2a Update dependencies
- Update SourceKitten from 0.19.1 to 0.20.0
- Update SWXMLHash from 4.3.6 to 4.6.0
- Update Yams from 0.5.0 to 0.7.0
2018-04-08 13:28:08 +09:00
Norio Nomura 2ab42cdec1 Fix typo 2018-04-05 11:17:35 +09:00
Norio Nomura c592538856 Add 4.1.0, 4.1.1 and 4.2.0 to Swift version detection 2018-04-05 10:29:54 +09:00
Keith Smiley 925fb26d83 Add LowerACLThanBodyRule
This new rule validates that if a type/function/variable definition has
an ACL specifier, it is more restrictive than the containing body's
level. This is intended to lint a peculiarity of SE-0025 where it is
stated:

> The compiler should not warn when a broader level of access control is
used within a type with more restrictive access, such as internal within
a private type. This allows the designer of the type to select the
access they would use were they to make the type more widely accessible.

I think this is an anti-goal because when a type is made more open, it
should be a concious decision at that time to make it public. This is of
course an opt-in rule as well. This also has the added benefit of
linting this compiler bug: https://bugs.swift.org/browse/SR-2925
2018-04-04 10:16:12 -07:00
Ornithologist Coder faee8c935b Adds opt-in rule discouraged_optional_collection 2018-03-26 00:26:13 +02:00
Marcelo Fabri ae0e21f0f8 Fix crash when saving cache
Fixes #2032
2018-03-24 21:23:14 -07:00
Frederick Pietschmann 0f93373e8a Rename RuleIdentifier.explicit to .single 2018-03-21 07:47:16 +01:00
Frederick Pietschmann 48c9aeb08a Adjust all keyword architecture + docs 2018-03-21 07:42:46 +01:00
Frederick Pietschmann 00154e9631 Improve map syntax 2018-03-21 07:42:46 +01:00
Frederick Pietschmann 7ac75e92d2 Fix logic error in rule disable check 2018-03-21 07:42:46 +01:00
Frederick Pietschmann fdbc391e52 Improve all keyword-related code
As per PR #2095 review, suggested by @marcelofabri
2018-03-21 07:42:46 +01:00
Frederick Pietschmann 0ad2488d7e Add all keyword 2018-03-21 07:42:46 +01:00
Daniel Metzing 96d29817b4 Add untyped_error_in_catch opt-in rule 2018-03-17 12:54:51 -07:00
Davide Sibilio 5c8d6069b6 Implemented empty_string rule (#2064)
Added empty_string rule
2018-03-17 11:47:04 -07:00
J Cheyo Jimenez 55bd3beeff modifierOrderRule added
```
opt_in_rules:
  - modifiers_order

modifiers_order:
  before_acl: ["override"]
  after_acl: ["class"]
```
2018-03-05 22:01:46 +01:00
Norio Nomura e11690ecb4 ObjCBool is no longer implicitly converted to Bool on Linux 2018-02-14 19:04:55 +09:00
Norio Nomura 1705167860 Swift 4.1 with -swift-version 3 is Swift 3.3 2018-02-14 19:04:55 +09:00
Norio Nomura 059ee7be94 'flatMap' is deprecated: renamed to 'compactMap(_:)' 2018-02-14 19:04:53 +09:00
Marcelo Fabri c875bed813 release 0.25.0 2018-02-11 22:15:36 -08:00
Marcelo Fabri 8c2c4b0a01 Fix false positive in empty_enum_arguments rule when using closures
Fixes #2041
2018-02-10 20:21:58 -08:00
Marcelo Fabri 03b4d6b020 Fix violations introduced when linting with Swift 4.1
Part of #2021
2018-02-03 22:23:48 -08:00
Marcelo Fabri d4346d2d37 Merge pull request #2013 from ornithocoder/optional_boolean
Adds opt-in discouraged_optional_boolean rule
2018-02-03 15:53:10 -08:00
Marcelo Fabri 5d7346b8a2 Don’t validate local vars in let_var_whitespace rule
As part of #2021
2018-01-25 20:00:31 -08:00
Marcelo Fabri 19c8536500 Fix false negative in unneeded_parentheses_in_closure_argument
Fixes #2017
2018-01-24 14:07:56 -08:00
Ornithologist Coder f485be257d Adds opt-in discouraged_optional_boolean rule 2018-01-22 00:44:23 +01:00
JP Simard 7bf32346cc release 0.24.2 2018-01-10 10:13:57 -08:00
JP Simard 7ad77df690 release 0.24.1 2018-01-08 15:21:59 -08:00