57 Commits
Author SHA1 Message Date
Dalton Claybrook d305e03905 Add inclusive_language rule (#3243)
Current events have renewed the conversation in our community about the roles of terminology with racist connotations in our software. Many companies and developers are now taking appropriate steps to remove this terminology from their codebases and products. (e.g. [GitHub](https://twitter.com/natfriedman/status/1271253144442253312)) This small rule prevents the use of declarations that contain any of the terms: whitelist, blacklist, master, and slave. It may be appropriate to add more terms to this list now or in the future.
2020-11-07 22:03:08 -05:00
Mikhail Monakov fc0092dc8c Add excluding by prefix option (#3345)
As we discussed here https://github.com/realm/SwiftLint/pull/3325 sometimes current excluding algorithm maybe slower than excluding paths by absolute prefix. So I added option for such cases.

Based on what I've checked it works faster for next scenarios:
- the number of input files is relatively small (e.g. when using `use-script-input-files`) and excluded directories contain relatively big number of lintable files
- the number of excluded directories relatively small (e.g. Pods + ThirdParty) and globs not used
2020-11-07 10:54:06 -08:00
David Harris 8c789bb3e2 feature: add config setting to exist successfully in case of no lintable (#2732)
files
2020-02-08 13:33:50 -08:00
Paul Taykalo ac40778cb3 Use SwiftLintFile wrapper over the File 2019-11-07 15:19:17 +02:00
Marcelo Fabri 187278feb2 Enable xct_specific_matcher on SwiftLint 2018-12-24 01:04:42 -08:00
JP Simard 0e862ca9c4 Enable vertical whitespace rules in SwiftLint
and fix violations
2018-12-02 14:01:23 -08:00
Marcelo Fabri b089769a40 Enable some opt-in rules 2018-09-08 20:25:45 -07:00
Keith Smiley 63edaa9081 Move alias tests to new file 2018-07-26 10:21:13 -07:00
Keith Smiley a807d723e4 Add support for globs in excluded paths 2018-07-26 10:21:13 -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
JP Simard fbeaaeb972 Use Sequence.reduce(into:) when possible 2018-04-22 20:46:46 -07:00
Ash Furrow e5ff6063ff Disables type length for test class. 2018-03-22 09:42:56 -07:00
Ash Furrow 173ca11b2a Adds more tests for #2056. 2018-03-22 09:42:56 -07:00
Ash Furrow 63658418c4 Adds unit test for force-exclude flag. 2018-03-22 09:42:56 -07:00
Marcelo Fabri 3945fb7935 Fix test when running with SPM 2018-02-11 18:22:59 -08:00
Jamie Edge 879a38dbea Sort filenames within path tests to allow for OS differences. 2018-02-11 18:01:10 -08:00
Jamie Edge 0920b4bbef Add test for directories with a '.swift' suffix being treated as files. 2018-02-11 18:01:09 -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
Noah McCann 424ff6906c Added additional test cases to verify indentation configuration. 2018-01-03 23:05:49 -08:00
Noah McCann 01debda323 Added Indentation to existing tests 2018-01-03 23:05:48 -08:00
JP Simard 3fb9f8ec4a remove superfluous 'disable' commands 2017-08-20 23:27:48 +02:00
Marcelo Fabri 182915dffa Add tests 2017-08-17 19:59:23 +02:00
JP Simard de08c7a447 reduce scope of disabled rule in ConfigurationTests.swift 2017-08-02 13:35:48 -07:00
Stéphane Copin f86a99ee66 Split ConfigurationTests.swift file in multiple files 2017-08-02 13:06:08 -07:00
Stéphane Copin 3ad4842bcd Small changes and refactoring based on github Feedback 2017-08-02 13:05:26 -07:00
Stéphane Copin 8e6c3edc39 Add more tests related to duplicated rules / all rules enabled Configurations 2017-08-02 13:05:26 -07:00
Stéphane Copin 9f1f454cf9 Refactor the way Configuration objects are created with regards to rules 2017-08-02 13:05:26 -07:00
Stéphane Copin a1ab5124d0 Add more tests related to nested configurations 2017-08-02 13:05:26 -07:00
Stéphane Copin f5f63c9072 Update tests to reflect nested configuration changes 2017-08-02 13:05:26 -07:00
Marcelo Fabri c01f4bd19f Enable extension_access_modifier rule 2017-07-21 21:08:52 +02:00
Marcelo Fabri 663081cfbd Fix crash when using --config and --path with a Swift file
Fixes #1694
2017-07-19 20:53:55 +02:00
J Cheyo Jimenez e72d09bc31 added fileprivateRule 2017-07-03 01:09:42 +02:00
Marcelo Fabri 68c1f3c1ab Fix configuration issue when using custom paths
Fixes #1631
2017-06-24 22:54:10 +02:00
Marcelo Fabri dbdc9f7788 Add a test for loading custom configuration 2017-06-13 21:41:48 +02:00
JP Simard 25a92c4e03 automatically generate LinuxMain.swift using Sourcery
This adds 6 tests that were accidentally not being run on Linux:

* LineLengthConfigurationTests.testLineLengthConfigurationInitialiserSetsIgnoresComments
* LineLengthConfigurationTests.testLineLengthConfigurationInitialiserSetsIgnoresFunctionDeclarations
* LineLengthConfigurationTests.testLineLengthConfigurationThrowsOnBadConfigValues
* LineLengthRuleTests.testLineLengthWithIgnoreCommentsEnabled
* LineLengthRuleTests.testLineLengthWithIgnoreFunctionDeclarationsEnabled
* RegionTests.testSeveralRegionsFromSeveralCommands
2017-06-02 14:28:37 -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 a150e2679c Updating test 2017-01-23 21:38:56 -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
JP Simard a291bb594a update SwiftLintFramework/Extensions to follow Swift 3 API Design Guidelines 2017-01-09 17:53:07 -08:00
Marcelo Fabri 3b682fb116 Remove support to non-deprecated aliases 2017-01-03 16:14:34 -02:00
Marcelo Fabri 989ed354fb Make tests work again on Linux 2017-01-03 15:25:51 -02:00
Marcelo Fabri 04fc177d84 PR feedback 2017-01-03 11:00:00 -02:00
Marcelo Fabri a5683fa393 PR feedback 2017-01-02 16:21:10 -02:00
Marcelo Fabri c82370842e Fixing tests on Linux 2017-01-02 16:21:10 -02:00
Marcelo Fabri 2e8ada85b1 Logging deprecation warning and adding tests 2017-01-02 16:21:10 -02:00
Marcelo Fabri 07b14d852f Handle duplicated alias configuration 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 55f7b04a6f Fixing existing violations 2016-12-26 18:44:37 -02:00
Marcelo Fabri c43f808cfc Re-enable ConfigurationTests.testExcludedPaths 2016-12-26 13:32:13 -02:00