David Potter
8748a4f3a2
Add guard statements to nonTriggeringExamples and triggeringExamples and fix tests.
2015-10-23 19:11:44 -07:00
David Potter
94b7ebdf36
Add support for the guard statement to ControlStatementRule.
2015-10-23 18:40:56 -07:00
JP Simard
57177e018d
update RulesCommand to print identifiers but not examples
2015-10-19 12:53:48 -07:00
Daniel Beard
4339a281df
PR comments
2015-10-07 11:16:20 -07:00
Daniel Beard
64cd034503
Change TrailingNewLine violation line to have an index within the file
2015-10-07 11:06:19 -07:00
JP Simard
0fd573c8b2
Deduplicate files in the current directory. Fixes #154 .
2015-10-06 15:51:30 -07:00
JP Simard
9321dfd9a0
Merge pull request #152 from realm/jp-merge-lint-command-code-paths
...
Merge stdin/non-stdin code paths, only log reports to stdout, chunk json/csv reports
2015-10-05 12:48:05 -07:00
JP Simard
87cd144b8a
Merge stdin/non-stdin code paths, only log reports to stdout, chunk json/csv reports
2015-10-05 11:57:07 -07:00
Keith Smiley
8e00730bea
Update yaml parsing to allow single value configurations
...
This updates the `arrayOfStrings` and `arrayOfInts` methods to also
accept a single value if they are not parsed as an array. This lets us
do this for our configuration:
line_length: 110
Instead of:
line_length:
- 110
If we only actually need a single value. The same goes for source
directories and other string keys.
2015-09-30 17:01:59 -07:00
Keith Smiley
fb32e31f8d
Merge pull request #142 from realm/ks-update-rule-descriptions
...
Update rule descriptions to not include specifics
2015-09-30 16:08:21 -07:00
JP Simard
d8c791f4e9
Merge pull request #141 from realm/ks-remove-allrules
...
Remove allRules
2015-09-30 13:49:54 -07: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
Keith Smiley
e320b2e363
Remove allRules
...
Now that the Configuration struct is creating a list of rules based on
optional yaml, this list duplicates the same behavior. By removing it
you no longer have to maintain duplicate lists of rules.
2015-09-30 13:18:12 -07:00
Keith Smiley
60ed23c21e
Remove duplicated Line declaration
...
This typealias is public from sourcekitten, so we don't need to
redeclare it here.
2015-09-30 13:11:07 -07:00
JP Simard
a71c9fbf01
Release 0.2.0: Tumble Dry
2015-09-30 09:57:23 -07:00
JP Simard
51dd2481ca
keep it functional, yo!
2015-09-30 09:44:12 -07:00
JP Simard
25017c4ea4
[Configuration] allow configuring parameterized rules from the configuration file
2015-09-21 11:08:29 -07:00
JP Simard
3c090e101f
Merge pull request #133 from realm/jp-custom-reporters
...
added custom reporters: xcode (default), json, csv. fixes #42
2015-09-20 00:09:00 +02:00
JP Simard
1bec2bcb23
use XcodeReporter for StyleViolation's description
2015-09-20 00:01:36 +02:00
JP Simard
ee79209db8
added custom reporters: xcode (default), json, csv. fixes #42
2015-09-19 17:48:32 +02:00
JP Simard
75f4122f63
generalize TodoRule
2015-09-04 13:57:16 -07:00
JP Simard
3f3c6e550f
further generalized TodoRule
2015-09-04 13:46:57 -07:00
JP Simard
e947f58669
Generalize TodoRule
...
as prompted by my own recommendations... doh! https://github.com/realm/SwiftLint/pull/126#issuecomment-137846688
2015-09-04 13:46:57 -07:00
Keith Smiley
33aa47e117
Remove unnecessary first Region
2015-09-04 13:30:57 -07:00
JP Simard
f3a7eff1a0
don't use \h in regex
2015-09-03 16:29:23 -07:00
JP Simard
7dd5ee1b15
Allow newlines in function return arrow. This prevented SwiftLint from linting
2015-09-03 15:23:21 -07:00
Keith Smiley
1b2373c40c
Remove unused count of trailing string extension
...
This method isn't very performant because it reverses the entire string
for comparison.
2015-09-03 13:41:58 -07: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
56fe7b0d3b
Merge pull request #111 from realm/jp-comment-commands
...
Disable/re-enable rules from within source code comments. Fixes #4 .
2015-08-31 17:03:03 -07:00
JP Simard
fe5f1affc9
ViolationSeverity is now only .Warning and .Error
2015-08-30 22:21:59 -07:00
JP Simard
7d85fe3261
converted Command/Region to structs and made Location Comparable
2015-08-29 21:45:55 -07:00
JP Simard
61d46c6c29
add tests for disabling rules via source code comments
2015-08-29 20:39:39 -07:00
JP Simard
fbc253a2ab
use single space in SwiftLint comment commands & fix issue with testTodoOrFIXME
2015-08-29 17:51:34 -07:00
JP Simard
71d9d57c80
'.+' not '.*' to match rule identifier
2015-08-29 17:39:21 -07:00
JP Simard
c10830e959
only match swiftlint commands in comments and match any rule identifier (oops)
2015-08-29 17:38:04 -07:00
JP Simard
c699d3d2fa
Disable/re-enable rules from within source code comments. Fixes #4 .
2015-08-29 17:09:28 -07:00
JP Simard
26627fa1b2
[TypeNameRule][VariableNameRule] allow private names to start with an underscore
2015-08-28 14:22:32 -07:00
JP Simard
57a8abb514
update for Xcode 7 Beta 6
2015-08-27 14:21:17 -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
29536759d1
update for Xcode 7 Beta 6
2015-08-27 14:20:51 -07:00
JP Simard
e95625ee79
update for swift 2
2015-08-27 14:20:51 -07:00
JP Simard
4c91500e7b
Release 0.1.2
2015-08-24 13:19:25 -07:00
Keith Smiley
3f9786a22d
Lint parentheses around switch statements
2015-08-24 11:24:51 -07:00
JP Simard
e7b7bf349a
fix style violation (failing test)
2015-08-23 22:17:02 -07:00
Keith Smiley
65f6715915
Improve trailing newline performance
...
This sidesteps the previous method of reversing the entire string from
every file by only checking the minimum number of trailing characters
for each file.
2015-08-14 20:30:40 -07:00
JP Simard
90dfe362a2
[OperatorFunctionWhitespaceRule] refactored rule. Fixes #60 .
2015-06-17 10:37:52 -07:00
akirahrkw
752d970bc9
fix:
...
remove <String.Index> because Range infers
use trailing closure syntax
2015-06-17 17:54:39 +08:00
akirahrkw
a2e0f2a06d
remove parameter(showExample) to use default value
2015-06-17 02:16:35 +08:00
akirahrkw
4d0b34012e
cleanup: remove unused variable
2015-06-17 02:11:44 +08:00