Commit Graph

69 Commits

Author SHA1 Message Date
JP Simard d269bde1fa allow trailing semicolons in comments 2015-11-17 11:41:02 -08:00
JP Simard 0a2b9e8a54 add trailing semicolon rule 2015-11-17 10:46:26 -08:00
JP Simard a45043bbaf use verifyRule to test Trailing Newline rule 2015-11-17 10:44:30 -08:00
JP Simard 8a30cb2e3d organize Xcode project
make Extensions, Models & Protocols groups under SourceKittenFramework
2015-11-15 15:07:25 -08:00
David Paschich 4af4909ad2 Filter out rules which don't exist rather than failing the configuration. 2015-11-12 20:55:07 -08:00
JP Simard 2131613166 no longer trigger a nesting violation for enums one level deep. fixes #190 2015-11-10 08:58:53 -08:00
Mickael Morier 91aa913c62 add 2 new parameter rules to check min and max length of variable names and remove length check in VariableNameRule 2015-11-07 03:03:08 +01: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
Alex Culeva aa1fc70c9c Add StatementPosition rule 2015-11-03 22:27:26 +02:00
Alex Culeva 5af582ca53 Add Comma rule 2015-11-03 22:05:31 +02:00
JP Simard 5b34dabe30 Merge pull request #176 from zippy1978/master
Added rule reference on command output to enable batch processing
2015-11-03 11:25:23 -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
Alex Culeva 023466e843 Add OpeningBrace Rule 2015-11-03 11:06:16 +02:00
Gilles Grousset f877af1720 Added rule id on RulesCommand and XcodeReporter 2015-11-01 02:16:34 +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
Daniel Beard 4339a281df PR comments 2015-10-07 11:16:20 -07:00
Daniel Beard 137cb6ad92 Fix tests 2015-10-07 11:15:18 -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
JP Simard ee79209db8 added custom reporters: xcode (default), json, csv. fixes #42 2015-09-19 17:48:32 +02: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 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 26627fa1b2 [TypeNameRule][VariableNameRule] allow private names to start with an underscore 2015-08-28 14:22:32 -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 9e417aeab9 Merge pull request #91 from keith/ks-test-only-active-rule
Only validate examples produce their own violations
2015-08-23 22:13:27 -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
Keith Smiley fdd814c64f Only validate examples produce their own violations
When adding new general rules, examples from other rules could violate
your new rule. Since we're already testing rules practically through the
integration tests we should only validate that examples produce the
expected violation types.
2015-08-11 15:37:09 -07:00
JP Simard 90dfe362a2 [OperatorFunctionWhitespaceRule] refactored rule. Fixes #60. 2015-06-17 10:37:52 -07:00
akirahrkw 56e2ffb95b add OperatorFunctionWhitespaceRule
#60 https://github.com/realm/SwiftLint/issues/60
2015-06-17 01:24:47 +08:00
akirahrkw fe4ef11939 change for ReturnArrowWhitespaceRule
1: uses default showExamples value (true)
2: uses default commentDoesntViolate value (true)
2015-06-04 01:47:58 +08:00
akirahrkw 87c7c5cd5d add ReturnArrowWhitespaceRule
This rule checks whether you have 1 space before return arrow and return type

Good: func abc() -> Int {}
Bad:  func abc()->Int {}
2015-06-03 16:26:21 +08:00
JP Simard 704e6009b1 [IntegrationTests] Added testSwiftLintLints(). Yo dawg. 2015-05-28 17:37:12 -07:00
JP Simard f8ea553a0e [Tests] Split LinterTests into 3 files 2015-05-28 16:49:30 -07:00
JP Simard 88c6e777f4 [Location] NSString.lineAndCharacterForByteOffset(_:) now works. Fixes #62. 2015-05-28 16:19:19 -07:00
JP Simard 7890e1c3be removed TODOs from LinterTests (created GH issues) 2015-05-28 15:15:51 -07:00
JP Simard 30ef86b144 [ControlStatementRule] Fixed a few false positives 2015-05-28 14:49:25 -07:00
JP Simard 26075a2d4f Trailing newline & file length violations are now displayed in Xcode: fixes #43 2015-05-28 12:11:13 -07:00
Andrea Mazzini 989685723d Enable commentDoesntViolate 2015-05-26 23:03:50 +02:00
Andrea Mazzini 383bd3de43 Add ControlStatementRule 2015-05-26 22:04:19 +02: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 31e4a3ec50 Moved nesting rule into example 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 ee5555f8a6 Whitespace rule examples 2015-05-25 14:45:28 -07:00
Chris Eidhof 7cdcc24f70 Added the TodoRule 2015-05-25 14:45:28 -07:00