Commit Graph

166 Commits

Author SHA1 Message Date
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
Marcelo Fabri 579872cd30 Handling multiline comments and correcting line count on violation reason 2016-01-14 20:26:20 -08:00
Marcelo Fabri 483fbc0a34 Fix identation 2016-01-14 20:24:47 -08:00
Marcelo Fabri 04b2510926 FunctionBodyLengthRule should not count comment lines 2016-01-14 20:24:47 -08:00
Scott Hoyt f693279fb5 Removed ParameterizedRule. Deleted unnecessary tests. Switched tests to ViolationLevelRuleMock where needed. 2016-01-13 19:45:27 -08:00
Scott Hoyt 7c6feec509 Added ViolationLevelRule and tests. 2016-01-13 19:45:27 -08:00
Aaron McTavish 20dbbe81b7 Implement LegacyConstantRule
From #319

CGGeometry: Prefer struct-scope constants CGRect.infinite, CGRect.null,
etc. over global constants CGRectInfinite, CGRectNull, etc.
2016-01-13 17:17:35 -08:00
JP Simard a5eb7c64fb [MissingDocsRule] skip inherited members when checking for missing docs 2016-01-13 16:41:08 -08:00
JP Simard 4e461bc9ba use shorter ACL strings when parameterizing MissingDocsRule
also fix the integration tests by using the configuration file
2016-01-13 16:41:02 -08:00
JP Simard a2f06246d0 improve MissingDocsRule
by checking for documentation comment body rather than doc comment attribute
2016-01-13 15:59:37 -08:00
JP Simard 9eabd45ce5 add "Missing Docs" rule 2016-01-13 15:59:37 -08:00
JP Simard 4c52163a70 add rule to encourage checking isEmpty over comparing count to zero 2016-01-13 15:41:25 -08:00
Scott Hoyt 55fa348b6d Made ParameterizedRule protocol inherit from ConfigurableRule with default implementation for conformance. 2016-01-11 11:21:49 -08:00