Commit Graph

24 Commits

Author SHA1 Message Date
Danny Mösch a02d4a76cb
Remove references to ManuallyTestedExamplesRule protocol (#4082)
Follow-up of d730e0b3fa.
2022-08-10 21:42:10 +00:00
Danny Mösch 449190d324
Verify examples in rules by default and enforce explicit exclusion (#4065)
A rule must conform to ManuallyTestedExamplesRule to skip generation of a test for its examples.
2022-08-09 22:32:09 +02:00
Marcelo Fabri db2721f78e
Require Swift 5.0 in runtime (#3886)
* Require Swift 5.0 in runtime

* Fix violation

* Enable legacy_rule by default

* Update changelog

* Fix changelog after rebase

* More cleanup
2022-03-11 14:01:27 -08:00
Zev Eisenberg fcf848608e
Add Inline test failure messages (#3040)
* Add Example wrapper in order to display test failures inline when running in Xcode.
* Stop using Swift 5.1-only features so we can compile on Xcode 10.2.
* Wrap strings in Example.
* Add Changelog entry.
* Wrap all examples in Example struct.
* Better and more complete capturing of line numbers.
* Fix broken test.
* Better test traceability.
* Address or disable linting warnings.
* Add documentation comments.
* Disable linter for a few cases.
* Limit mutability and add copy-and-mutate utility functions.
* Limit scope of mutability.
2020-02-02 10:35:37 +02:00
JP Simard 399f5b7df6
Fix docstring formatting issues using DrString (#3032)
Using command:
$ drstring check -i 'Source/**/*.swift' --first-letter lowercase --vertical-align
2020-01-12 11:19:33 -08:00
JP Simard 37167a8a35
Add documentation comments to all public declarations (#3027) 2020-01-08 09:47:10 -08:00
JP Simard 3a0c2b0c05
Migrate LinterCache to use Codable models (#2799)
* Migrate LinterCache to use Codable models

improving performance and type safety

* Fix Linux

* Avoid creating a Decoder if it won't be used

For example if the file doesn't exist or can't be read.

* Use corelibs plist coder if available

It's available in the Swift 5.1 branch: https://github.com/apple/swift-corelibs-foundation/pull/1849

* Remove unused error case
2019-07-07 00:35:10 -07:00
JP Simard 0e862ca9c4
Enable vertical whitespace rules in SwiftLint
and fix violations
2018-12-02 14:01:23 -08:00
Marcelo Fabri 1f121b1ef7 Enable static_operator opt-in rule in SwiftLint 2018-09-16 20:33:28 -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 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
Marcelo Fabri 5231f6c9a5 Support min Swift version in Rule description 2018-04-08 21:52:45 -07:00
Marcelo Fabri e86763739f Move kind to RuleDescription 2017-07-02 15:50:16 +02:00
Marcelo Fabri 3b682fb116 Remove support to non-deprecated aliases 2017-01-03 16:14:34 -02:00
Marcelo Fabri d9ae32bfd1 Use Set for aliases in RuleDescription init 2017-01-02 16:23:03 -02:00
Marcelo Fabri 2e9e016723 Running "disable" tests on all aliases 2017-01-02 16:21:10 -02:00
Marcelo Fabri df8429d2eb Add support for rule aliases 2017-01-02 16:21:10 -02:00
Marcelo Fabri 13b0cfe623 Fixing inconsistencies 2016-12-08 18:29:57 -02:00
JP Simard c66c5c8df0 formatting fixes
found running `swiftlint autocorrect --format`
2016-05-29 14:58:28 -07: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 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 7933d7c23a add dictionary of corrections to RuleDescription
pre-correction keys map to post-correction values
2015-12-05 21:09:43 -08:00
JP Simard c257fc7180 add RuleDescription.consoleDescription 2015-11-30 01:48:45 -08:00
JP Simard 8a30cb2e3d organize Xcode project
make Extensions, Models & Protocols groups under SourceKittenFramework
2015-11-15 15:07:25 -08:00