Commit Graph

157 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
Varun P M 794160a8d2 Added ignores_default_parameters when calculating parameter count 2018-05-10 17:40:30 +05:30
Eric Horacek d21b787980 Make closure end indentation rule correctable 2018-05-08 21:00:19 -07: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 8e0202cfc8 Added violation marker and fixed tests 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 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 6ff33e675b Refactor 2018-05-05 16:24:54 -07: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 9a7005912a Add modifiers_order rule 2018-04-26 20:25:58 +02: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
Norio Nomura 2a0ac455bc 'flatMap' is deprecated: renamed to 'compactMap(_:)' 2018-04-08 13:28:09 +09:00
Cyril Lashkevich 10ba712748 Fix for crash on Linux on sources with surrogate characters
Because of the bug https://bugs.swift.org/browse/SR-5971 SwiftLint
crashes when linting on Linux files like https://github.com/xmartlabs/Eureka/blob/master/Example/Example/ViewController.swift
2018-03-17 19:51:24 +01:00
Daniel Metzing d02a650786 Fixing tests after rebase 2018-03-05 22:11:10 +01: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
rounak 639522163f Improve console description for ExplicitTypeInterfaceConfiguration
Add more tests for ExplicitTypeInterface
2018-02-25 19:18:38 -08:00
rounak e515f43424 Add separate test files for ExplicitTypeInterfaceRule & Config
Respond to PR comments
2018-02-25 19:18:38 -08:00
Rounak 975bd7b86e Fix linter warnings 2018-02-25 19:18:38 -08:00
Rounak 2a7abcf542 Add new configuration for Explicit Type Interface Rule to allow exempting certain types of variables
Signed-off-by: Rounak <rounak91@gmail.com>
2018-02-25 19:18:38 -08:00
Norio Nomura 49f3d00e7b Changed incorrectly used flatMap to map 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
Donald Ritter 1deddf2334 Adds a new rule which allows for enums that conform to protocol to
require cases.
2017-12-22 13:08:51 -05:00
JP Simard 34f429b0a3 Fix caching on Linux
This has never worked for two reasons:

1. We've used dictionaries to represent cache descriptions, which
   don't guarantee stable ordering of keys across invocations.
   This is true both on Darwin and Linux, but in practice ordering
   varies significantly more on Linux.
2. Storing a `TimeInterval` value in a `[String: Any]` dictionary
   and retrieving it again will not be dynamically castable to
   `Double` or `TimeInterval` but will be castable to `Int`.
2017-10-26 12:23:13 -07:00
Marcelo Fabri 0be8c855d2 Move functions to properties and Sets instead of Arrays 2017-10-04 14:34:00 -07:00
Marcelo Fabri 05685785f2 Merge pull request #1864 from marcelofabri/improve-allowed-symbols
Fix false negatives when using allowed_symbols
2017-10-01 01:11:46 -03:00
Marcelo Fabri be341f90b9 Introduce queuedFatalError
`fatalError` prints the full path of the file, which leaks filesystem information from the machine that built the binary. Now that we release via CocoaPods, this is more critical.
2017-09-30 15:07:23 -03:00
Marcelo Fabri 06f9d4c0f7 Fix false negatives when using allowed_symbols 2017-09-30 00:50:30 -03:00
JP Simard b829893b7d lower ACL of declarations that should be private 2017-08-08 09:10:31 -07: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
Ornithologist Coder a9cc8e573a More code review 2017-08-01 19:29:48 +02: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
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 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
Marcelo Fabri c01f4bd19f Enable extension_access_modifier rule 2017-07-21 21:08:52 +02:00
Marcelo Fabri a4aeaedbe0 Add tests and improve behavior 2017-07-18 17:57:59 +02:00
Jamie Edge 04c487929e Add support for optional 'error' severity level in configurations. 2017-07-18 16:50:26 +02:00
JP Simard 42c8db92b1 fix a number of uncaught colon spacing violations 2017-07-10 22:57:13 -07:00
Marcelo Fabri e86763739f Move kind to RuleDescription 2017-07-02 15:50:16 +02:00