Commit Graph

528 Commits

Author SHA1 Message Date
JP Simard 4ffb9358d0 rename CustomRulesConfig to CustomRulesConfiguration 2016-02-12 10:53:36 -08:00
JP Simard 144495306b rename rule configurations to expand "Config" to "Configuration" 2016-02-12 10:53:36 -08:00
JP Simard b2d954f655 rename ConfigType to ConfigurationType 2016-02-12 10:53:36 -08:00
JP Simard 5ad4e88ac0 move RuleConfigs to RuleConfigurations 2016-02-12 10:53:36 -08:00
JP Simard 7e07e813ca rename RuleConfig to RuleConfiguration 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 d9cd1d670a rename Rule.init(config:) to Rule.init(configuration:) 2016-02-12 10:53:36 -08:00
JP Simard db71448c47 rename Rule.configDescription to Rule.configurationDescription 2016-02-12 10:53:36 -08:00
JP Simard 3f4b993847 rename ConfigProviderRule to ConfigurationProviderRule 2016-02-12 10:53:36 -08:00
JP Simard 048c5dda84 expand "config" to "configuration" in Configuration.swift
with an exception being made for the "use_nested_configs" configuration key,
since that's already long enough as it is
2016-02-12 10:53:36 -08:00
JP Simard 24e3adc355 make Configuration.configPath public 2016-02-10 17:26:06 -08:00
JP Simard 1af80bcc31 remove Configuration.disabledRules 2016-02-10 17:26:06 -08:00
JP Simard 1866edae77 adjust access control levels for many APIs in SwiftLintFramework
this is done in an effort to stabilize the API for SwiftLint 1.0.
2016-02-10 17:26:06 -08:00
JP Simard c662407c17 fix #522 2016-02-10 16:11:24 -08:00
JP Simard 7d0afb190b rename matchAndTokensPattern to rangesAndTokensMatching
also align regex pattern comments & fix indentation
2016-02-10 15:42:07 -08:00
Norio Nomura 83c008507b Improve performance of ColonRule
The duration of `ColonRule` on linting Carthage 0.13 is reduced from 1673ms to 515ms by Instruments.
2016-02-10 15:16:21 -08:00
Norio Nomura 03b237ecb2 Improve performance of FunctionParameterCountRule
The duration of `FunctionParameterCountRule` on linting Carthage 0.13 is reduced from 787ms to 208ms by Instruments.
2016-02-11 00:48:29 +09:00
JP Simard fe110a81ed add an integration test to ensure SwiftLint autocorrects successfully 2016-02-08 14:23:36 -08:00
JP Simard 31dc6b0a59 only correct legacy constructors if they're tokenized as identifiers 2016-02-08 14:22:02 -08:00
JP Simard 214d7069e2 udpate RuleList.configuredRulesWithDictionary now that ConfigurableRule is just Rule 2016-02-08 13:37:19 -08:00
JP Simard 714902ef01 treat single values as an array in the configuration dictionary 2016-02-08 13:24:14 -08:00
JP Simard 5e118070ce log an error when supplying invalid keys in the configuration dictionary 2016-02-08 13:24:14 -08:00
JP Simard 09e9d62056 print deprecation warning for 'enabled_rules' to stderr rather than stdout
to follow the convention used elsewhere in the project as to not invalidate
the output structure from formatted violation reporters like json, csv &
checkstyle.
2016-02-08 13:24:14 -08:00
JP Simard 711f23a9b9 introduce private ConfigurationKey enum in Configuration.swift
this should replace all the hardcoded string literals representing configuration
dictionary keys.
2016-02-08 13:24:14 -08:00
JP Simard 70c1008591 use constant strings rather than literals in Configuration.swift 2016-02-08 13:24:14 -08:00
JP Simard a0524644f5 move Configuration.rulesFromDict to RuleList.configuredRulesWithDictionary 2016-02-08 13:24:13 -08:00
JP Simard 59da7f3ce9 add --quiet flag to lint and autocorrect commands
addresses #386
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 b7b4177dda Merge pull request #508 from realm/jp-improve-rules-table-configuration-description
make RulesCommand show a configuration description for all rules
2016-02-08 13:08:16 -08:00
Norio Nomura 94fabdd11d Add fflush(stdout) before fputs(…, stderr)
`Swift.print()` uses buffered stdout by calling `putchar(_:)`.
This avoids mixing strings from stdout and stderr.

fix #432
2016-02-08 10:26:49 +09:00
JP Simard 3ccfa5780d Merge pull request #499 from realm/jp-fix-statement-position
fix inconsistencies between violations & corrections in StatementPositionRule
2016-02-07 15:50:30 -08:00
JP Simard 71135c6a4b make RulesCommand show a configuration description for all rules 2016-02-07 10:40:51 -08:00
JP Simard f3b6cc08f7 minor style change replacing '{ }' with '{}'
to stay consistent with other empty functions
2016-02-07 10:21:43 -08:00
JP Simard f4105b4502 fix inconsistencies between violations & corrections in StatementPositionRule 2016-02-07 10:13:27 -08:00
Ankit Aggarwal 41f59d6004 Ignore case of keywords for valid_docs 2016-02-07 22:29:19 +05:30
JP Simard 422b4a0b0b fix wording for function parameter count rule
fixes #504
2016-02-06 18:55:16 -08:00
JP Simard 5d11862fce Merge pull request #495 from realm/jp-lint-command-reporter
allow passing an optional `--reporter` parameter to `swiftlint lint`
2016-02-06 14:58: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 3e3bb7bb90 Optimize excludingPattern in violatingOpeningBraceRanges()
Fix #491
By applying this, on linting KeychainAccess:
from(0.8.0):
```
swiftlint lint --config ~/.swiftlint-test.yml  29.61s user 0.18s system 98% cpu 30.175 total
```
to:
```
swiftlint lint --config ~/.swiftlint-test.yml  1.92s user 0.06s system 91% cpu 2.160 total
```
2016-02-06 16:16:15 +09:00
Scott Hoyt e4d007d014 Version bump to 0.8.0 2016-02-05 19:35:07 -08:00
JP Simard b2a7b707ab print rule configuration 2016-02-03 10:31:53 -08:00
Scott Hoyt a723e146b4 Added corrections for if and multi-line if to OpeningBraceRule. 2016-02-02 17:16:13 -08:00
Scott Hoyt a8ba805f19 Added more triggering and non-triggering examples for OpeningBraceRule. 2016-02-02 17:16:13 -08:00
Scott Hoyt d17f5b9d92 Modified access level of matchPattern(_, excludingSyntaxKinds:, excludingPattern:) 2016-02-02 17:15:00 -08:00
Scott Hoyt 2a623e926e Eliminated unneeded local variable. 2016-02-02 17:15:00 -08:00
Scott Hoyt 9c910862b1 Modified exclusion regex for OpeningBraceRule. 2016-02-02 17:15:00 -08:00
Scott Hoyt ebaa6ec871 Increase performance by early return if matches isEmpty. 2016-02-02 17:15:00 -08:00
Scott Hoyt 0ee04c3fa3 Added exclusion pattern for matching patterns in a file. Added Array and NSRange extensions to support. Used this in OpeningBraceRule. 2016-02-02 17:15:00 -08:00
Denis Lebedev a87253b5bf Measure complexity of nested functions separately 2016-02-02 16:18:27 -08:00
Denis Lebedev 22668504db Do not use 1 as initial value for Cyclomatic complexity 2016-02-02 15:56:37 -08:00