Commit Graph

48 Commits

Author SHA1 Message Date
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
Scott Hoyt 05a65afc72 Removed ViolationLeveLRule in favor of ConfigurationProviderRule. 2016-01-23 17:42:13 -08:00
Scott Hoyt 9f7ea52f9f Migrated LineLengthRule to ViolationLevelRule. 2016-01-13 19:45:27 -08:00
Norio Nomura 7fa100a033 Reduce calls to String.characters.count in LineLengthRule.validateFile(_:)
By applying this, the duration of linting Carthage is reduced from:
```
swiftlint lint  20.07s user 1.10s system 84% cpu 25.023 total
```
to:
```
swiftlint lint  18.27s user 1.05s system 84% cpu 22.769 total
```
2016-01-10 20:44:36 +09:00
JP Simard 76b30ee19b make all rule descriptions follow a consistent format 2015-11-17 10:18:29 -08:00
JP Simard 0335f155ab Perform major refactor of rule description, identifiers and examples
Fixes #183.
2015-11-04 12:24:33 -08:00
JP Simard 5cb80cfd22 All rules now print their identifiers in reports. Fixes #180. 2015-11-04 10:30:36 -08:00
Gilles Grousset 7feb26ebe2 Refactored Rule reference in StyleViolation
Now uses a String with the rule identifier
2015-11-03 13:31:29 +01:00
Gilles Grousset 7328b41da8 Added rule reference to StyleViolation
- Added rule reference to StyleViolation
- Added rule_id field on JSONReporter and CSVReporter
2015-11-01 02:00:04 +01:00
Keith Smiley fa97ce073a Update rule descriptions to not include specifics
Now that configuration of rules has been added, having these hard coded
lengths is no longer valid.
2015-09-30 13:22:37 -07:00
JP Simard 25017c4ea4 [Configuration] allow configuring parameterized rules from the configuration file 2015-09-21 11:08:29 -07:00
Keith Smiley d12f9cc271 Move to SourceKitten's File lines
The new lines property on File is a cached version of the same lines.
This means we don't have to compute these multiple times during linting.
2015-09-03 11:50:50 -07:00
JP Simard fe5f1affc9 ViolationSeverity is now only .Warning and .Error 2015-08-30 22:21:59 -07:00
JP Simard 19cc87a404 Configure SwiftLint via a YAML file. Fixes #1 and #3. 2015-08-27 14:21:17 -07:00
JP Simard e95625ee79 update for swift 2 2015-08-27 14:20:51 -07:00
JP Simard 5402b8214e more minor changes to rules command 2015-05-25 15:37:38 -07:00
JP Simard a68a886d3f minor tweaks 2015-05-25 15:23:21 -07:00
Chris Eidhof e7a4e9f651 Rename examples from correct/failure to non-triggering and triggering 2015-05-25 14:46:14 -07:00
Chris Eidhof 20fd31672a List of all the rules 2015-05-25 14:46:13 -07:00
Chris Eidhof 89ea957b05 Changed RuleExample to be a struct 2015-05-25 14:46:13 -07:00
JP Simard e2df0546d3 Split Rule into Rule and ParameterizedRule protocols (fixes #21) 2015-05-20 18:27:16 +02:00
Aaron Daub 15a100153d Have the Rule protocol define its members as non-static so that we can pass around instances of Rule 2015-05-19 07:44:11 +02:00
JP Simard 2dbd06d5aa generalized rules and split off LineLengthRule 2015-05-18 05:08:04 +02:00