JP Simard
a0524644f5
move Configuration.rulesFromDict to RuleList.configuredRulesWithDictionary
2016-02-08 13:24:13 -08:00
JP Simard
8270c80e22
fix tests on SPM
2016-02-08 13:21:40 -08:00
JP Simard
9ee4e2e077
fix tests
2016-02-08 13:21:40 -08:00
JP Simard
368ee9544a
fold ConfigurableRule into Rule
2016-02-08 13:08:51 -08:00
JP Simard
9b55b8923a
move assertCorrection into Configuration extension
...
to not clog up verifyRule, making it harder to read.
2016-02-07 10:13:27 -08:00
JP Simard
3872e5680f
test that non-triggers are never corrected and that corrections are never no-ops
2016-02-07 10:13:27 -08:00
JP Simard
c4ed26c05c
allow passing an optional --reporter parameter to swiftlint lint
2016-02-06 11:14:23 -08:00
Norio Nomura
3c53a23363
[SPM] Fix build errors and test fails
...
Add `import Foundation` explicitly.
Change getting paths from using `NSBundle` to static string if `SWIFT_PACKAGE`
Add `SWIFT_PACKAGE` to some condition
2016-02-03 14:01:08 +09:00
Norio Nomura
43f99fffb4
[SPM] Make test cases conform to XCTestCaseProvider
2016-02-03 13:56:34 +09:00
Norio Nomura
267417e9a5
[SPM] Add Source/SwiftLintFrameworkTests/main.swift
...
That also added to `project.pbxproj` for browsing in Xcode's Project Navigator.
That used only on building by SPM
2016-02-03 13:04:55 +09:00
JP Simard
b70006da03
fix order of testFunctionParameterCountRule
2016-01-31 14:09:11 -08:00
Denis Lebedev
b9676eb58f
Rename ParametersListLengthRule -> FunctionParameterCountRule
2016-01-31 14:09:11 -08:00
Denis Lebedev
81e7f347ce
Implement ParametersListLengthRule
2016-01-31 14:09:11 -08:00
Daniel Beard
998bed9716
Add whitelist only rules
2016-01-29 13:55:31 -08:00
Robin Kunde
f65b9d3e44
Disable SeverityLevelsConfig error ruleParam if only warning is set. This prevents the potential creation of invalid configs by implicit definition in Yaml.
2016-01-28 10:39:15 -08:00
JP Simard
98fe6c4c81
fix Xcode 7.3 compilation
...
XCTest APIs now use StaticString instead of String for file names
and we can't create a StaticString for violation file names, so just revert
to the old XCTest check
2016-01-26 16:51:30 -08:00
Benjamin Otto
fccd2796d1
Changed location for force unwrapping rule violation
...
- Changed the `Location` of the StyleViolation to point to the `!` that actually does the unwrapping
2016-01-26 10:48:40 -08:00
Scott Hoyt
b76a3d2ae6
Added tests.
2016-01-25 07:26:31 -08:00
JP Simard
0742edcc8e
drop redundant "Rule" from function names in RulesTests
2016-01-24 13:43:50 -08:00
JP Simard
ac27ef3206
sort all RulesTests and make all tests follow consistent naming
2016-01-24 13:29:47 -08:00
JP Simard
41902fc5a1
moved tests from ASTRuleTests to RulesTests
2016-01-24 13:21:52 -08:00
JP Simard
1db304e848
renamed StringRuleTests.swift to RulesTests.swift
2016-01-24 13:20:52 -08:00
JP Simard
4ae7f2fca9
use verifyRule to test FileLengthRule
2016-01-24 13:18:19 -08:00
JP Simard
e0e0ec4e68
use verifyRule to test LineLengthRule
2016-01-24 13:15:31 -08:00
JP Simard
a9f681955b
use verifyRule to test TypeBodyLengthRule
2016-01-24 13:06:50 -08:00
JP Simard
1fa78ee11b
unify test names
2016-01-24 12:44:17 -08:00
JP Simard
5d0c5609b4
removed duplicate testTypeName()
2016-01-24 12:44:17 -08:00
JP Simard
af566fe9a5
rename testTypeNames to testTypeName & remove testNestedTypeNames
...
since it wasn't testing anything very useful
2016-01-24 12:44:17 -08:00
JP Simard
2b286b67b7
refactor testTypeNames to use verifyRule
2016-01-24 12:44:17 -08:00
Denis Lebedev
dbb7938f54
Add POC of complexity rule
2016-01-24 12:34:32 -08:00
Norio Nomura
78a810fd0f
Generate assertion on every violations in testSwiftLintLints()
...
It makes violations browsable on Xcode's Issue Navigator.
2016-01-24 18:15:33 +09:00
Scott Hoyt
12aba5f1b0
Rebased. Fixed new conflicts.
2016-01-23 17:48:36 -08:00
Scott Hoyt
943ed306a3
Modified names for brevity.
2016-01-23 17:42:13 -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
Scott Hoyt
7af4756e73
Added SeverityConfig and tests.
2016-01-23 17:42:13 -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
421aa6e4c8
Added tests for NameConfig.
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
d137dcdbf2
Remove VariableNameRuleConfig in leu of adding excluded to MinMaxLengthConfig. Reduced length of length violation message.
2016-01-23 17:42:13 -08:00
Scott Hoyt
0691b79a08
Rename Rule Configurations.
2016-01-23 17:42:13 -08:00
Scott Hoyt
ddcde17f04
Add min and max length checking responsibilities to VariableNameRule.
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
b92c24136c
Fixed tests for throwing ConfigurableRule init.
2016-01-23 17:42:13 -08:00
Marcelo Fabri
0c630720b6
Refactoring testTypeBodyLengths to compile faster
2016-01-21 22:59:08 -08:00
Marcelo Fabri
3416217927
TypeBodyLengthRule should not count comment and whitespace lines
2016-01-21 22:29:38 -08:00
JP Simard
c9246542ad
fix infinite recursion when using nested config files. Fixes #368
2016-01-21 12:49:04 -08:00
JP Simard
04267a499e
rewrite FunctionBodyLengthRuleTests to compile 500x faster
...
before:
10828.9ms @objc func testFunctionBodyLengthsWithComments()
10250.3ms @objc func testFunctionBodyLengthsWithMultilineComments()
1236.7ms @objc func testFunctionBodyLengths()
after:
18.5ms @objc func testFunctionBodyLengths()
16.0ms private func funcWithBody(body: String) -> String
6.5ms @objc func testFunctionBodyLengthsWithMultilineComments()
5.7ms @objc func testFunctionBodyLengthsWithComments()
2016-01-18 14:15:39 -08:00
Marcelo Fabri
75a4f2f2dc
Changing reason message
2016-01-14 21:24:24 -08:00
Marcelo Fabri
12eb3fece7
Updating reason message
2016-01-14 20:47:17 -08:00