Commit Graph

47 Commits

Author SHA1 Message Date
JP Simard 9e7cdc3282 update SwiftLintFramework/Protocols to follow Swift 3 API Design Guidelines 2017-01-09 19:19:25 -08:00
JP Simard a291bb594a update SwiftLintFramework/Extensions to follow Swift 3 API Design Guidelines 2017-01-09 17:53:07 -08:00
JP Simard 0faf567931 use bridge() rather than explict or implicit casts
this is a step in aligning the code to compile on both Darwin and
Linux
2016-12-11 13:47:44 -08:00
Marcelo Fabri 13b0cfe623 Fixing inconsistencies 2016-12-08 18:29:57 -02: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 3ff76e7ce8 Update SourceKitten 2016-11-04 20:24:21 +09:00
Javier Hernández 418b82449e Fix check for trailing whitespace to return early 2016-11-04 07:19:56 +00:00
Javier Hernández 7107dfd7b6 Fix checks for some inline comments 2016-11-04 07:19:56 +00:00
Javier Hernández 90420aa0c9 Replace check for comments to use SyntaxKind 2016-11-04 07:19:56 +00:00
Javier Hernández 84b8b03e89 Add configuration for trailing_whitespace to ignore comments 2016-11-04 07:19:56 +00:00
Norio Nomura 8bf15f1dba Migrate to Swift 3.0 2016-10-09 01:09:50 +09:00
J Cheyo Jimenez 48a085cfc1 Added disable rule test to autocorrect 2016-08-30 15:41:17 -07:00
JP Simard 5a640b4c32 simplify TrailingWhitespaceRule.validateFile 2016-06-07 14:55:39 -07:00
JP Simard cb6d30f6d3 extract makeConfig() out of XCTestCase.verifyRule 2016-06-07 14:45:11 -07:00
Reimar Twelker b92af7a8b2 Changed var to let 2016-06-07 14:15:32 -07:00
Reimar Twelker 76656e17b5 Fixed line-length and trailing-whitespace warnings 2016-06-07 14:15:32 -07:00
Reimar Twelker d8733e8830 Uses the new TrailingWhitespaceConfiguration type.
If the `ignoresEmptyLines` flag of the configuration is `true`, validation does not report and correction does not correct whitespace-indented empty lines.
2016-06-07 14:15:00 -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
Scott Hoyt f722bcf360 All Rules (with the exception of MissingDocs) now provide some severity configuration. 2016-01-23 17:42:13 -08:00
JP Simard d5598d4eae add missing imports needed by SPM 2016-01-22 21:09:28 -08:00
Scott Hoyt 9b6f3070a3 Wrote ConfigurableRule, made ParameterizedRule's conform, moved configuration into rules themselves. 2016-01-11 11:21:49 -08:00
JP Simard 7a12c49560 Don't correct if a rule is disabled locally 2015-12-05 21:09:43 -08:00
JP Simard 5be62adfd4 report corrections 2015-12-05 21:09:43 -08:00
JP Simard cea94ce255 autocorrect trailing whitespace violations 2015-12-05 21:09:43 -08:00
JP Simard 96a4e6cc2f remove init() from Rule. 2015-11-29 21:43:53 -08:00
JP Simard 989127cbe0 [StyleViolation] use RuleDescription's description when reason is nil
Many cases just used a static string that was nearly identical to the rule
description as the `reason` parameter when initializing a StyleViolation.
2015-11-17 10:25:57 -08: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 7a6028f1dd Optimize trailing whitespace rule
This updates the rule to no longer reverse each line in each file.
Instead the last character in each line is individually checked for
whitespace.
2015-09-03 13:41:58 -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 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
Chris Eidhof 1456f067c0 Only show examples when it makes sense 2015-05-25 14:46:00 -07:00
Chris Eidhof ee5555f8a6 Whitespace rule examples 2015-05-25 14:45:28 -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 9d497a41f5 TrailingWhitespaceRule 2015-05-18 05:21:29 +02:00