Commit Graph

72 Commits

Author SHA1 Message Date
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 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
JP Simard 93ded518a7 Remove uses of String.characters, deprecated in Swift 4.0.2 2017-11-10 14:37:53 -08:00
Marcelo Fabri 0be8c855d2 Move functions to properties and Sets instead of Arrays 2017-10-04 14:34:00 -07:00
JP Simard 2c94e54bd6 Fix 'is_disjoint' violations in SwiftLint itself 2017-08-21 16:00:34 -07:00
Marcelo Fabri e86763739f Move kind to RuleDescription 2017-07-02 15:50:16 +02:00
Marcelo Fabri 5012211d3d Add RuleKind 2017-07-02 15:50:16 +02:00
Marcelo Fabri fd231b607d Fix existing violations 2017-06-13 16:12:58 +02:00
JP Simard 69f885cf08 small refactoring after #1264 2017-02-09 14:42:09 -08:00
Marcelo Fabri 2300ae3daf Small style changes 2017-02-06 21:59:30 -02:00
Michael Welles 15a7a88297 Modified so that kinds(forByteOffset:) does not require a separate
filter() setup of the results
2017-02-06 15:58:45 -05:00
Michael Welles c9ff0aa07f Changes from PR feedback. Long comments following code in a line will now trigger, configuration will now fail if invalud value types are set for options 2017-02-06 15:33:44 -05:00
Michael Welles cd843e7fcd Added "ignores_comments" and "ignores_function_declarations" as boolean options to LineLengthRule 2017-01-30 17:51:56 -05:00
JP Simard 9e7cdc3282 update SwiftLintFramework/Protocols to follow Swift 3 API Design Guidelines 2017-01-09 19:19:25 -08:00
Javier Hernández cf2c7ced39 Move method to strip urls to String extension 2017-01-06 01:05:54 +01:00
Javier Hernández d58d26f526 Use regex to cache the regular expression 2017-01-06 01:05:54 +01:00
Javier Hernández 384c7a8507 Use NSRegularExpression to fix the rule on Linux 2017-01-06 01:05:54 +01:00
Javier Hernández e87ecc684a Add import to fix tests running with SPM 2017-01-06 01:05:54 +01:00
Javier Hernández ed42d9b38e Add line length configuration to ignore urls 2017-01-06 01:05:54 +01:00
Javier Hernández 2c82458426 Add check to ignore urls for line_length rule 2017-01-06 01:05:54 +01:00
Marcelo Fabri d480c865bd Fix violation 2016-12-22 21:21:23 -02:00
Marcelo Fabri 1ff53bd04a Changing the default line length limit to 120
Fixes #1008
2016-12-20 12:07:25 -02:00
Marcelo Fabri 13b0cfe623 Fixing inconsistencies 2016-12-08 18:29:57 -02:00
Norio Nomura f1e7311575 Fix trailing_comma violations 2016-11-30 19:41:28 +09:00
Norio Nomura 40828dff03 Merge branch 'master' into swift3.0
* master: (41 commits)
  Fix formatting in CHANGELOG.md
  release 0.13.0
  Update CHANGELOG.md
  Fix check for trailing whitespace to return early
  Fix checks for some inline comments
  Replace check for comments to use SyntaxKind
  Add configuration for trailing_whitespace to ignore comments
  Unwanted space removed
  - Lint issues fixed
  Updated HTML Reporter
  PR feedback
  Add check on autocorrect for disabled range
  Use `utf8.count` instead of `utf16.count` to byte range
  Re-write `ExplicitInitRule` to `ASTRule`
  added ExplicitInitRule
  Updated CHANGELOG
  HTML Reporter added
  HTML Reporter added
  Adds information about SwiftLint plugin for AppCode into README.md
  added reasons why a new rule should be opt in
  ...

# Conflicts:
#	Source/SwiftLintFramework/Extensions/File+SwiftLint.swift
#	Source/SwiftLintFramework/Extensions/Structure+SwiftLint.swift
#	Source/SwiftLintFramework/Rules/ColonRule.swift
#	Source/SwiftLintFramework/Rules/CommaRule.swift
#	Source/SwiftLintFramework/Rules/LegacyCGGeometryFunctionsRule.swift
#	Source/SwiftLintFramework/Rules/LegacyConstantRule.swift
#	Source/SwiftLintFramework/Rules/LegacyConstructorRule.swift
#	Source/SwiftLintFramework/Rules/LegacyNSGeometryFunctionsRule.swift
#	Source/SwiftLintFramework/Rules/LineLengthRule.swift
#	Source/SwiftLintFramework/Rules/OperatorFunctionWhitespaceRule.swift
#	Source/SwiftLintFramework/Rules/ReturnArrowWhitespaceRule.swift
#	Source/SwiftLintFramework/Rules/RuleConfigurations/StatementPositionConfiguration.swift
#	Source/SwiftLintFramework/Rules/StatementPositionRule.swift
#	Source/SwiftLintFramework/Rules/TrailingWhitespaceRule.swift
#	Tests/SwiftLintFramework/RuleConfigurationTests.swift
2016-11-04 21:40:56 +09:00
Norio Nomura c16efa15fb Merge pull request #807 from masters3d/closure-spacing
added closure-spacing-rule
2016-10-24 19:30:13 +09:00
Norio Nomura e8450f1c62 Merge branch 'master' into swift3.0
* master:
  changelog formatting
  Remove whitespace
  Extract literal stripping into function, add image literal stripping
  Adds newlines for consistent markdown markup
  Fix indentation
  Adds enhancement entry to changelog.md
  Adds triggering and non-triggering example, color literals are treated as any other characters
  Switches to using substring replacement of temporary string in order to detect multiple color literals in one line
  Improves line length and whitespace to satisfy linting of source file
  Color literals counts as single character towards line count

# Conflicts:
#	Source/SwiftLintFramework/Rules/LineLengthRule.swift
2016-10-14 20:06:12 +09:00
Jonas Wippermann ae942d4b9e Remove whitespace 2016-10-13 21:31:33 +02:00
Jonas Wippermann c6e2a621dd Extract literal stripping into function, add image literal stripping 2016-10-13 21:30:16 +02:00
Jonas Wippermann 848790e54d Fix indentation 2016-10-13 20:54:13 +02:00
Jonas Wippermann 59ed827009 Adds triggering and non-triggering example, color literals are treated as any other characters 2016-10-09 13:29:34 +02:00
Jonas Wippermann 068e3093cc Switches to using substring replacement of temporary string in order to detect multiple color literals in one line 2016-10-09 10:34:53 +02:00
Jonas Wippermann be63968901 Improves line length and whitespace to satisfy linting of source file 2016-10-08 22:32:45 +02:00
Norio Nomura 8bf15f1dba Migrate to Swift 3.0 2016-10-09 01:09:50 +09:00
Jonas Wippermann 11f324d9d7 Color literals counts as single character towards line count 2016-10-07 23:18:24 +02:00
J Cheyo Jimenez 8bed233282 added closure-spacing-rule 2016-09-03 21:10:33 -07: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 144495306b rename rule configurations to expand "Config" to "Configuration" 2016-02-12 10:53:36 -08:00
JP Simard 6befe7e5a4 expand many instances of "config" to "configuration" 2016-02-12 10:53:36 -08:00
JP Simard 3f4b993847 rename ConfigProviderRule to ConfigurationProviderRule 2016-02-12 10:53:36 -08:00
Norio Nomura 5ebd64629a Improve performance of LineLengthRule
This depends on https://github.com/jpsim/SourceKitten/pull/152
The duration of linting Carthage 0.11 is reduced from 17sec to 16sec
SwiftLint(32b325b) with SourceKitten(0f54e19):
```
swiftlint lint --config ~/.swiftlint-test.yml  17.48s user 1.12s system 83% cpu 22.182 total
```
SwiftLint(this) with SourceKitten(d7f9266):
```
swiftlint lint --config ~/.swiftlint-test.yml  16.31s user 1.05s system 85% cpu 20.313 total
```
2016-01-31 13:57:37 -08:00
JP Simard e0e0ec4e68 use verifyRule to test LineLengthRule 2016-01-24 13:15:31 -08:00
Scott Hoyt 989bac7ec8 Renamed SeverityLevelConfig to SeverityLevelsConfig. 2016-01-23 17:42:13 -08:00
Scott Hoyt 3230c6413e Replaced things in rule configurations named configuration for config to save space. 2016-01-23 17:42:13 -08:00
Scott Hoyt a64f9eddbd SeverityLevelConfig stores levels as Ints now. 2016-01-23 17:42:13 -08:00
Scott Hoyt 0691b79a08 Rename Rule Configurations. 2016-01-23 17:42:13 -08:00
Scott Hoyt 873edb724b Provided convenience property params for RuleLevelsConfig. 2016-01-23 17:42:13 -08:00