Commit Graph

36 Commits

Author SHA1 Message Date
Ornithologist Coder 371e7b4995 Run format before autocorrect (#2383) 2018-09-02 14:35:39 -07:00
JP Simard 2bcea4b04d Add ability for SwiftLint to lint files with full type-checked AST awareness (#2379)
* Add LintableFilesVisitor

* Move LintCommand logic into LintOrAnalyzeCommand

to prepare for the upcoming analyze command

* Add AnalyzeCommand (not fully implemented yet in SwiftLintFramework)

* Add analyzerRules configuration member

* Add AnalyzerRule protocol

* Pass compiler arguments to validate/correct

* Add requiresFileOnDisk member to RuleDescription

This will be used by AnalyzerRules because they need a file on disk
to pass in the compiler arguments to SourceKit.

* Exclusively run AnalyzerRules when the Linter has compiler arguments

* Enable testing AnalyzerRules in TestHelpers

* Add ExplicitSelfRule

* Update documentation

* Fix `analyze --autocorrect`

* Improve performance of CompilerArgumentsExtractor

* Fix lint command actually running analyze

* Move File operations in TestHelpers into a private extension

* Add analyzer column to rules command and markdown documentation

* Use a Set literal

* Make AnalyzerRule inherit from OptInRule

* Mention analyzer_rules in readme

* Mention that analyzer rules are slow
2018-09-02 00:13:27 -07:00
JP Simard b38758b902 Completely remove deprecated --use-tabs option (#2376) 2018-09-01 12:50:31 -07:00
Ben Asher 32e8c5bbc3 Fix extra array copies 2018-07-23 10:13:55 -07:00
Ben Asher 7f86dc4c44 Fix paths arg eating other params 2018-07-23 10:13:55 -07:00
Ben Asher 3f1acd6ca1 Prefer single path, if it's provided; fix multi-path 2018-07-23 10:13:55 -07:00
Ben Asher 7a32b8d4c2 Support for multiple paths 2018-07-23 10:13:55 -07:00
Marcelo Fabri 701abbea94 Don’t overwrite file when formatting if not needed
Fixes #2249
2018-06-24 11:38:38 -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
John Szumski a1f5fb9ee0 Fixed issue where the autocorrect done message used the plural form of "files" even if only 1 file changed. 2018-03-27 21:49:00 -04:00
Ash Furrow f80f9c8897 Adds autocorrect config for force-excludes. 2018-03-22 09:42:56 -07:00
JP Simard 623590acd1 Update dependencies 2018-02-01 15:35:41 -08:00
Noah McCann beb2e03610 Added backwards compatibility for use-tabs and deprecation warning 2018-01-03 23:05:48 -08:00
Noah McCann 093367073a Renamed IndentationMode to Indentation, better handled default value 2018-01-03 23:05:48 -08:00
Noah McCann fb67afa185 AutoCorrect now uses indentationMode rather than options 2018-01-03 23:05:48 -08:00
Noah McCann 3c7f8d05f4 Revert "Added indent-width option for swiftlint autocorrect"
This reverts commit 7531bbace2.
2018-01-03 23:05:48 -08:00
Noah McCann b161ee00ad Added indent-width option for swiftlint autocorrect 2018-01-03 23:05:48 -08:00
Marcelo Fabri f58ade89bb Fix existing violations 2017-09-13 19:47:25 -03:00
JP Simard 18ab900e5a update swiftlint CLI module to compile with Swift 4 from Xcode 9 beta 3 2017-07-18 11:59:22 -07:00
Marcelo Fabri 4dcbc5e441 Parallel autocorrect
Fix #1578
2017-07-15 22:52:25 +02:00
Cody Winton 3f089d6a0d Added use-tabs option for swiftlint autocorrect 2017-07-15 21:18:44 +02:00
JP Simard bbfa8059b5 refer to correct action in AutoCorrectCommand's option usage 2017-07-10 22:17:04 -07:00
Marcelo Fabri fd231b607d Fix existing violations 2017-06-13 16:12:58 +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 9db40bf3e1 update swiftlint/Extensions to follow Swift 3 API Design Guidelines 2017-01-10 08:00:17 -08:00
JP Simard 4ec7fd9917 remove unnecessary imports from AutoCorrectCommand.swift 2017-01-01 22:00:31 -08:00
Norio Nomura 8bf15f1dba Migrate to Swift 3.0 2016-10-09 01:09:50 +09:00
JP Simard 88ac48580d add --format option to autocorrect command 2016-05-29 13:58:45 -07:00
JP Simard 5b6f2e46da move common Commandant options to separate file 2016-02-11 15:40:48 -08:00
JP Simard 59da7f3ce9 add --quiet flag to lint and autocorrect commands
addresses #386
2016-02-08 13:21:40 -08:00
JP Simard 8012fab729 remove Curry dependency
The syntax is going away in Swift 3, and it's not that hard to do ourselves.
2016-01-22 16:35:55 -08:00
JP Simard 3cbae967a4 set configuration.rootPath in AutoCorrectCommand
this is a more correct fix than checking that path != "/" when merging
configurations, but let's keep that check more as an assertion to make sure
we never recurse infinitely.
2016-01-21 15:42:13 -08:00
Syo Ikeda 5b47fa25de Fix test failures 2016-01-04 08:58:08 +09:00
Syo Ikeda ac79c8be99 Update Commandant to 0.8.1 2016-01-04 08:58:08 +09:00
JP Simard b653973776 re-introduce use-script-input-files option for lint & autocorrect 2015-12-13 16:59:01 -08:00
JP Simard 14e675b85d add dedicated autocorrect command 2015-12-05 21:09:43 -08:00