Commit Graph

53 Commits

Author SHA1 Message Date
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
Norio Nomura 2a0ac455bc 'flatMap' is deprecated: renamed to 'compactMap(_:)' 2018-04-08 13:28:09 +09: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
Marcelo Fabri 96c6a13a92 Fix disabling superfluous_disable_command rule
Fixes #1890
2017-10-06 16:29:35 -03:00
JP Simard 2c94e54bd6 Fix 'is_disjoint' violations in SwiftLint itself 2017-08-21 16:00:34 -07:00
Marcelo Fabri 70488c9f0c Add SuperfluousDisableCommandRule 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 0bf1179c83 Validating trailing closure even if there's only one param 2017-07-24 00:50:31 +02:00
Marcelo Fabri c01f4bd19f Enable extension_access_modifier rule 2017-07-21 21:08:52 +02:00
Marcelo Fabri 33955234b3 Skip files with valid cache & no violations when auto correcting 2017-05-28 12:47:52 +02:00
JP Simard bd7169e40c cache each file with its own configuration cache description
to make the cache play nicely with nested configurations
2017-05-18 14:31:33 -07:00
Víctor Pimentel 5ed010c9c0 Change LinterCache to use file modification dates instead of hashing files with a weak algorithm. 2017-05-18 13:39:05 -07:00
Marcelo Fabri 2a97a1cd3d PR feedback 2017-01-10 20:53:17 -02:00
Marcelo Fabri 94f48f4ebd PR feedback 2017-01-10 13:09:18 -02:00
Marcelo Fabri e1e2369c5f Merge branch 'master' into cache 2017-01-10 12:54:30 -02:00
JP Simard 9e7cdc3282 update SwiftLintFramework/Protocols to follow Swift 3 API Design Guidelines 2017-01-09 19:19:25 -08:00
JP Simard c5c2e21120 update SwiftLintFramework/Models to follow Swift 3 API Design Guidelines 2017-01-09 19:05:29 -08:00
Marcelo Fabri 8af6552b73 Merge branch 'master' into cache 2017-01-04 13:37:24 -02:00
Marcelo Fabri 3c9d16509b Fix unit tests 2017-01-02 18:27:28 -02:00
JP Simard 4519f463d8 extract Linter.getStyleViolations' parallelFlatMap into Rule.performLint 2017-01-02 12:01:33 -08:00
Marcelo Fabri d9eda655bf PR feedback 2017-01-02 17:49:54 -02:00
Marcelo Fabri 119c214492 Merge remote-tracking branch 'upstream/master' into cache 2017-01-02 16:29:32 -02:00
Marcelo Fabri f5569986a3 Only dispatching if there are identifiers 2017-01-02 16:26:16 -02:00
Marcelo Fabri c0aacd6adb Log deprecation warns for commands 2017-01-02 16:23:03 -02:00
JP Simard 253e1f4f86 make recording benchmarks thread-safe 2016-12-31 17:24:43 -08:00
JP Simard d82ca686d2 parallelize getting violations for a single file 2016-12-30 23:08:26 -08:00
Marcelo Fabri 3d376241be Moving cache usage to the linter 2016-12-31 00:26:05 -02:00
JP Simard 8fd337727b improve wording when SourceKit fails 2016-12-25 22:52:19 -08:00
Marcelo Fabri b18c98084c Fix existing violations 2016-12-22 11:57:06 -02:00
Marcelo Fabri 5cccc12eb7 Style changes because of the 120 length limit 2016-12-20 12:10:11 -02:00
Marcelo Fabri 13b0cfe623 Fixing inconsistencies 2016-12-08 18:29:57 -02:00
JP Simard a57526d639 omit 'self.' references when not ambiguous 2016-12-08 01:25:54 -08:00
Norio Nomura 8bf15f1dba Migrate to Swift 3.0 2016-10-09 01:09:50 +09:00
Norio Nomura 9c0a2492e8 Refactor ASTRule and add SourceKitFreeRule
- Make `ASTRule` to generic and remove `ASTBaseRule`
- Add `SourceKitFreeRule` and remove `RuleDescription.needsSourceKit`
2016-04-16 22:32:53 +09:00
Norio Nomura ad50e35c4e Add ASTBaseRule
`ASTBaseRule` takes kind as `String` for supporting other than `SwiftDeclarationKind`.
`ASTRule` inherits `ASTBaseRule`.
2016-04-16 08:30:00 +09:00
Norio Nomura 5cc6d3243a On SourceKitd failed, continue linting the file by limited rules that does not use SourceKitd
Add `RuleDescription.needsSourceKit` indicating the rule needs SourceKit.
If `ASTRule` or `needsSourceKit` is true, skip linting if SourceKitd fails.
2016-04-13 18:40:25 +09:00
JP Simard c4ed26c05c allow passing an optional --reporter parameter to swiftlint lint 2016-02-06 11:14:23 -08:00
Norio Nomura a583b8e22c Rename label of tuple
It fixes following error:
> Source/swiftlint/Commands/LintCommand.swift:35:27: error: cannot invoke 'appendContentsOf' with an argument list of type '([(rule: String, time: Double)])'
>                ruleTimes.appendContentsOf(currentRuleTimes)
>                          ^
>Source/swiftlint/Commands/LintCommand.swift:35:27: note: expected an argument list of type '(C)'
>                ruleTimes.appendContentsOf(currentRuleTimes)
>                          ^

It seems Swift does not allow label mismatch on that.
2016-02-01 13:23:55 +09:00
Norio Nomura fe6cdb2bdc Add calls invalidateCache() on every corrections in Linter.correct()
Cache entry should be invalidate on every corrections,
because caches and content may not match after corrections.
2016-01-30 15:46:47 +09:00
JP Simard 6a3c3bfa3b also benchmark rule times when running lint with --benchmark 2016-01-25 23:27:30 -08:00
JP Simard d8167e83d7 add --benchmark option to LintCommand
to benchmark how long each file took to lint
2016-01-25 23:27:30 -08:00
JP Simard ace0999154 update SourceKitten to 0.8.0 2016-01-22 19:19:15 -08:00
JP Simard f9f9d3c10e get correctable rules by casting configured rules as CorrectableRule 2015-12-05 21:09:43 -08:00
JP Simard 7a12c49560 Don't correct if a rule is disabled locally 2015-12-05 21:09:43 -08:00
JP Simard c08c300c20 Don't correct if a rule is disabled globally 2015-12-05 21:09:43 -08:00
JP Simard 5be62adfd4 report corrections 2015-12-05 21:09:43 -08:00
JP Simard f30b0791db autocorrect trailing semicolon violations 2015-12-05 21:09:43 -08:00
JP Simard e953a3a57b autocorrect trailing newline violations 2015-12-05 21:09:43 -08:00
JP Simard cea94ce255 autocorrect trailing whitespace violations 2015-12-05 21:09:43 -08:00