Commit Graph

214 Commits

Author SHA1 Message Date
Marcelo Fabri d4e2f91f34 Small changes and refactoring 2017-07-23 00:16:32 +02:00
Samuel Susla 84860461cb Ignore comment lines in file length rule 2017-07-23 00:16:32 +02:00
Marcelo Fabri c01f4bd19f Enable extension_access_modifier rule 2017-07-21 21:08:52 +02:00
Marcelo Fabri a4aeaedbe0 Add tests and improve behavior 2017-07-18 17:57:59 +02:00
Jamie Edge 04c487929e Add support for optional 'error' severity level in configurations. 2017-07-18 16:50:26 +02:00
JP Simard 42c8db92b1
fix a number of uncaught colon spacing violations 2017-07-10 22:57:13 -07:00
Marcelo Fabri e86763739f Move kind to RuleDescription 2017-07-02 15:50:16 +02:00
Marcelo Fabri 102bca6155 Use validates_start_with_lowercase key on NameConfiguration
Fixes #1626
2017-06-18 20:13:31 +02:00
Cihat Gündüz ad03a2f2d0 Add ObjectLiteralConfiguration with color/image options
This fixes #1587 by implementing the discussed option config.
2017-06-15 06:07:43 +02:00
JP Simard cea6f43f37
make PrivateUnitTestRule & its configuration conform to CacheDescriptionProvider 2017-05-19 09:30:09 -07:00
JP Simard 0c0952046c
ensure deterministic consoleDescription & cacheDescription generation 2017-05-19 09:25:53 -07:00
JP Simard f639ae95f1
add CacheDescriptionProvider protocol
to provide more complete descriptions for cache invalidation
purposes.
2017-05-18 14:31:33 -07:00
Javier Hernández 9d31eaccda Rename option to validates_start_lowercase 2017-05-10 20:53:44 +01:00
Javier Hernández fe916c121f Add option to allow names to start with uppercase 2017-05-10 20:53:44 +01:00
Javier Hernández 93583f3153 Add option to exclude non alphanumeric characters 2017-05-10 20:53:42 +01:00
Marcelo Fabri db66e74ccd Merge pull request #1499 from marcelofabri/complexityConfigTypo
Fix `ignores_case_statements` key in `cyclomatic_complexity` description
2017-05-07 17:11:50 +02:00
Jeffrey Blagdon 2e3130048f Fix `ignores_case_statements` key in `cyclomatic_complexity` description
Fixes #1434.
2017-05-07 17:10:21 +02:00
Marcelo Fabri 6805c4a1e0 Merge pull request #1480 from marcelofabri/unused_optional_binding_rule_ignore_option
Unused optional binding rule ignore option
2017-05-07 17:03:15 +02:00
Marcelo Fabri 2282362989 Remove extra parenthesis on file header rule description 2017-05-04 21:37:34 +02:00
Сергей Галездинов 74e77e82bb Additional configuration for UnusedOptionalBindingRule 2017-05-01 14:59:00 +02:00
Nigel Flack 6321e24877 Adds support for excluded in custom rules 2017-04-14 15:14:45 +01:00
JP Simard 691d79f650
break out FileHeaderConfiguration.consoleDescription
to speed up type checking.

It took 18 seconds to type check on Homebrew's Jenkins job when
submitting 0.18.0: https://github.com/Homebrew/homebrew-core/pull/12161
2017-04-06 15:59:24 -07:00
Keith Smiley b410c9376a
Update optional interpolated strings for Xcode 8.3 2017-04-06 13:37:49 -07:00
Marcelo Fabri e26710c0ad Merge pull request #1362 from SiarheiFedartsou/implicitly_unwrapped_optional_rule
Add `implicitly_unwrapped_optional` rule
2017-03-22 21:16:18 +01:00
Siarhei Fedartsou e6c718bdbd Fix operator in ColonConfiguration 2017-03-19 13:19:55 +03:00
Siarhei Fedartsou 2e579aaa6c Add configuration for `implicitly_unwrapped_optional_rule`, add triggering on complex types(AnyCollection<Int!> for ex.) 2017-03-19 00:27:13 +03:00
Siarhei Fedartsou fe8359a81d Add `implicitly_unwrapped_optional` rule 2017-03-18 00:01:32 +03:00
JP Simard 1d27ae1549 Merge pull request #1299 from mlwelles/cyclomatic_complexity_ignores_case_statments
Cyclomatic complexity ignores case statments
2017-03-10 15:19:46 -08:00
t_hayashi 6872018862 Add configuration for NestingRule 2017-03-04 01:14:30 +09:00
Michael Welles a6175faad0 made adjustments per PR feedback, added tests for cyclomatic complexity configuration class 2017-02-15 11:20:17 -05:00
Michael Welles d561b1acf6 Merge branch 'master' of github.com:realm/SwiftLint into cyclomatic_complexity_ignores_case_statments 2017-02-10 11:17:37 -05:00
JP Simard a10156b5eb
update LineLengthConfiguration.consoleDescription after #1264 2017-02-09 14:42:10 -08:00
JP Simard 69f885cf08
small refactoring after #1264 2017-02-09 14:42:09 -08:00
Michael Welles 42a7186e45 Added ignores case statements as option to cyclomatic complexity rule 2017-02-09 15:09:49 -05:00
Marcelo Fabri 2300ae3daf Small style changes 2017-02-06 21:59:30 -02:00
Michael Welles 15a7a88297 Modified so that kinds(forByteOffset:) does not require a separate
filter() setup of the results
2017-02-06 15:58:45 -05:00
Michael Welles c9ff0aa07f Changes from PR feedback. Long comments following code in a line will now trigger, configuration will now fail if invalud value types are set for options 2017-02-06 15:33:44 -05:00
Michael Welles ccc840b340 Changed LineLengthConfigurationFlag enum to be an OptionSet struct, per pull request feedback 2017-01-31 13:56:26 -05:00
Michael Welles cd843e7fcd Added "ignores_comments" and "ignores_function_declarations" as boolean options to LineLengthRule 2017-01-30 17:51:56 -05:00
Bjarke Hesthaven Søndergaard 4a9d354210 Fixes to comply with review 2017-01-16 20:38:29 +01:00
Bjarke Hesthaven Søndergaard ad749ac9f7 Add minimum_fraction_length configuration 2017-01-16 18:40:11 +01:00
JP Simard a98b0c0070
address some PR feedback 2017-01-09 19:28:08 -08:00
JP Simard 9e7cdc3282
update SwiftLintFramework/Protocols to follow Swift 3 API Design Guidelines 2017-01-09 19:19:25 -08:00
Marcelo Fabri 50535e7e5c Refactor regex functions to accept options
Fixes #1127
2017-01-06 21:04:15 -02:00
Javier Hernández cf2c7ced39 Move method to strip urls to String extension 2017-01-06 01:05:54 +01:00
Javier Hernández ed42d9b38e Add line length configuration to ignore urls 2017-01-06 01:05:54 +01:00
Aaron McTavish 00b8e79318
Add `max_empty_lines` config to `vertical_whitespace`
Update `vertical_whitespace` rule to allow configuration of the number
of consecutive empty lines before a violation using `max_empty_lines`.
The default value is still 1 line.
2017-01-05 10:05:03 +00:00
Marcelo Fabri 5282134fec Remove unnecessary import 2017-01-02 03:25:04 -02:00
Marcelo Fabri d44bf896b9 Avoid duplicating default value 2017-01-02 02:55:41 -02:00
Marcelo Fabri 09a251a8f6 number_separator can be configured with a min length
Fixes #1109
2017-01-02 02:50:04 -02:00
Marcelo Fabri f7cb7bae2c PR feedback 2016-12-22 00:09:27 -02:00
Marcelo Fabri 1d06302643 Add dictionary colon validation to colon rule
Fixes #603
2016-12-22 00:09:27 -02:00
JP Simard 80e34272a2 minor changes to ProhibitedSuperConfiguration 2016-12-13 00:11:55 -08:00
Aaron McTavish f54c9c4d5a
Add ProhibitedSuperRule
Resolves #970: `Rule: Methods calling super that should not`
2016-12-13 07:22:11 +00:00
Marcelo Fabri 482dd16833 Dates 2016-12-12 23:04:42 -02:00
Marcelo Fabri fd09fde10e Trying to fix Linux build 2016-12-12 01:32:36 -02:00
Marcelo Fabri 9c43a21fed Merge branch 'master' into attributes-rule 2016-12-11 23:46:18 -02:00
JP Simard 89526264db
improve RegexConfiguration 2016-12-11 16:49:28 -08:00
JP Simard 3431ef4798
improve PrivateUnitTestRule 2016-12-11 16:41:45 -08:00
JP Simard 38c221b698
break up SeverityConfiguration.applyConfiguration(_:)
to help the type checker
2016-12-11 16:23:49 -08:00
JP Simard 54acf03983
use NSRegularExpression with a placeholder pattern to compile on Linux
since `NSRegularExpression.init()` isn't available on Linux yet.
2016-12-11 14:04:49 -08:00
JP Simard 49b5ee665d
omit needless types in static calls in PrivateUnitTestConfiguration.swift 2016-12-11 14:04:49 -08:00
JP Simard 43edeeba25
eliminate needless conditional casts in FileHeaderConfiguration 2016-12-11 13:48:41 -08:00
Marcelo Fabri 2ddf7757d7 Merge branch 'master' into attributes-rule 2016-12-09 14:50:48 -02:00
Marcelo Fabri 13b0cfe623 Fixing inconsistencies 2016-12-08 18:29:57 -02:00
Marcelo Fabri 54d8958386 PR feedback 2016-12-08 18:29:57 -02:00
Marcelo Fabri ac0b0824c9 Swift 3 migration 2016-12-08 18:29:57 -02:00
Marcelo Fabri b4a3c17b41 Initial work to support configuration in file header rule 2016-12-08 18:29:57 -02:00
JP Simard a57526d639
omit 'self.' references when not ambiguous 2016-12-08 01:25:54 -08:00
Marcelo Fabri 1d42d29714 Merge branch 'master' into attributes-rule 2016-12-04 18:36:06 -02:00
Marcelo Fabri 0c018a15c7 Swift 3 migration 2016-12-04 18:19:44 -02:00
JP Simard 576e1a5d4d
remove unnecessary .lowercased() calls
now that ViolationSeverity is already lowercase.
2016-12-01 22:29:09 -08:00
JP Simard 19fad01b29
make all enum members lowercase to comply with Swift 3 API Guidelines 2016-12-01 22:16:21 -08:00
JP Simard 0b481f1e16
change Array.arrayOf(_:) to Array.array(of:) 2016-12-01 18:09:38 -08:00
Marcelo Fabri 5e9095a1e3 PR feedback 2016-11-30 11:51:25 -02:00
Marcelo Fabri 12dae9c029 Handling parameters and custom configurations 2016-11-30 11:51:25 -02:00
Norio Nomura b7862b9f6a
Merge commit 'e0cafea80ffba746a103d8d5a25be8fcd0993c81' into swift3.0
* commit 'e0cafea80ffba746a103d8d5a25be8fcd0993c81':
  remove unnecessary file.invalidateCache()
  add changelog entry for #893
  fix up indentation in MarkRule.swift
  omit self if it can be inferred
  Corrections for mark rule
  Update regex part to be more precise.
  Add autocorrection to MarkRule

# Conflicts:
#	Source/SwiftLintFramework/Rules/ConditionalReturnsOnNewline.swift
#	Source/SwiftLintFramework/Rules/MarkRule.swift
#	Source/SwiftLintFramework/Rules/StatementPositionRule.swift
2016-11-30 22:26:51 +09:00
Norio Nomura 191e022ca2
Merge commit 'e63c6ce4172f201554ab70c0e4fec694d82d8f60' into swift3.0
* commit 'e63c6ce4172f201554ab70c0e4fec694d82d8f60':
  Use severityConfiguration in rules == function
2016-11-30 19:41:44 +09:00
Norio Nomura 84ca11b6aa
Merge commit 'b22d1a93c93537acde79a2496031012489fe270d' into swift3.0
* commit 'b22d1a93c93537acde79a2496031012489fe270d':
  Updating CHANGELOG entry
  Updates existing code to respect TrailingCommaRule
  Add configuration to enforce/forbid trailing comma
  Fixing rebase
  Addded TrailingCommaRule
2016-11-30 19:38:31 +09:00
JP Simard 4bb23dd75a
omit self if it can be inferred 2016-11-28 22:18:56 -08:00
Marcelo Fabri 6a8ebe61c6 Use severityConfiguration in rules == function 2016-11-26 23:50:52 -02:00
Marcelo Fabri 3bacc80fc7 Add configuration to enforce/forbid trailing comma 2016-11-25 23:51:25 -02:00
Norio Nomura 40828dff03
Merge branch 'master' into swift3.0
* master: (41 commits)
  Fix formatting in CHANGELOG.md
  release 0.13.0
  Update CHANGELOG.md
  Fix check for trailing whitespace to return early
  Fix checks for some inline comments
  Replace check for comments to use SyntaxKind
  Add configuration for trailing_whitespace to ignore comments
  Unwanted space removed
  - Lint issues fixed
  Updated HTML Reporter
  PR feedback
  Add check on autocorrect for disabled range
  Use `utf8.count` instead of `utf16.count` to byte range
  Re-write `ExplicitInitRule` to `ASTRule`
  added ExplicitInitRule
  Updated CHANGELOG
  HTML Reporter added
  HTML Reporter added
  Adds information about SwiftLint plugin for AppCode into README.md
  added reasons why a new rule should be opt in
  ...

# Conflicts:
#	Source/SwiftLintFramework/Extensions/File+SwiftLint.swift
#	Source/SwiftLintFramework/Extensions/Structure+SwiftLint.swift
#	Source/SwiftLintFramework/Rules/ColonRule.swift
#	Source/SwiftLintFramework/Rules/CommaRule.swift
#	Source/SwiftLintFramework/Rules/LegacyCGGeometryFunctionsRule.swift
#	Source/SwiftLintFramework/Rules/LegacyConstantRule.swift
#	Source/SwiftLintFramework/Rules/LegacyConstructorRule.swift
#	Source/SwiftLintFramework/Rules/LegacyNSGeometryFunctionsRule.swift
#	Source/SwiftLintFramework/Rules/LineLengthRule.swift
#	Source/SwiftLintFramework/Rules/OperatorFunctionWhitespaceRule.swift
#	Source/SwiftLintFramework/Rules/ReturnArrowWhitespaceRule.swift
#	Source/SwiftLintFramework/Rules/RuleConfigurations/StatementPositionConfiguration.swift
#	Source/SwiftLintFramework/Rules/StatementPositionRule.swift
#	Source/SwiftLintFramework/Rules/TrailingWhitespaceRule.swift
#	Tests/SwiftLintFramework/RuleConfigurationTests.swift
2016-11-04 21:40:56 +09:00
Javier Hernández 84b8b03e89 Add configuration for trailing_whitespace to ignore comments 2016-11-04 07:19:56 +00:00
Brian Lu 21c4303bad Fix "Statment" typos 2016-10-21 21:07:37 -04:00
Angel Garcia 6161c9b001 Renamed rule and configuration to OverridenSuperCall 2016-10-20 09:44:18 +02:00
Angel Garcia 2d758dd70d Changed resolvedMethodNames to compute on configuration changes only 2016-10-19 11:20:31 +02:00
Angel Garcia 83141c1967 List of methods sorted by class+method name 2016-10-17 13:42:19 +02:00
Norio Nomura ec3f9d0c94
Fix line_length style violations, unused warnings 2016-10-13 22:40:45 +09:00
Norio Nomura 8bf15f1dba
Migrate to Swift 3.0 2016-10-09 01:09:50 +09:00
Angel Garcia b3edc678a9 fixed white spacing 2016-09-26 11:29:33 +02:00
Angel Garcia 47ef5ca100 Added more methods to list of super calls 2016-09-06 11:06:19 +02:00
Angel Garcia 96de4ee866 Added super call configuration list 2016-09-05 10:59:06 +02:00
Cristian Filipov a60bcddc8f Fix #786: Private unit test rule not scoped to tests 2016-08-29 21:03:09 -07:00
rohan 26daddcf0d Adding new configuration for private outlet rules to allow private(set) 2016-08-25 00:08:05 -07:00
Cristian Filipov ea592e0e98 Add rule to check for private unit tests 2016-08-18 17:17:03 -07:00
bootstraponline 0d78cdb0c2 Add included to custom rules 2016-06-23 10:21:45 -04:00
Michael Skiba b2ad5fc5fb Code Review Updates
- renamed "standard" to "default"
- Updated formatting per code review
- added note to changelog
2016-06-09 21:57:35 -04:00
Michael Skiba d0247a382f added autocorrect support to the uncuddled else rule 2016-06-09 14:37:09 -04:00
Michael Skiba 7a56338eb0 uncuddled else folded into statement position
still needs autocorrect
2016-06-09 14:35:34 -04:00
JP Simard 25b7dc5cd5 remove redundant `Bool ? "true" : "false"` 2016-06-07 14:48:40 -07:00
Reimar Twelker 2917d939d9 Reduced setting `ignoresEmptyLines` in `applyConfiguration(_:)` to a single line 2016-06-07 14:15:32 -07:00
Reimar Twelker 7d0cd39abd Fixed line-length warning 2016-06-07 14:15:32 -07:00
Reimar Twelker 183e448530 Added severity to `consoleDescription` 2016-06-07 14:15:32 -07:00
Reimar Twelker a6b9fb0304 Changed expected value of `ignores_empty_lines` setting to Bool 2016-06-07 14:15:32 -07:00
Reimar Twelker 7e56b46024 Changed to match the actual keyword used in the configuration file 2016-06-07 14:15:32 -07:00
Reimar Twelker 76656e17b5 Fixed line-length and trailing-whitespace warnings 2016-06-07 14:15:32 -07:00
Reimar Twelker 940b0c194e Added a `RuleConfiguration` subclass specifically for the trailing whitespace rule.
Its `ignoresEmptyLines` flag controls whether the rule should ignore whitespace-indented empty lines when detecting violations and correcting files. By default, the flag is false.
2016-06-07 14:14:29 -07:00
JP Simard c66c5c8df0 formatting fixes
found running `swiftlint autocorrect --format`
2016-05-29 14:58:28 -07:00
Norio Nomura 39282654f4 Fix `conditional_binding_cascade` violations 2016-04-16 08:30:00 +09:00
JP Simard 601470ab8f expand some instances of "config" to "configuration" 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