Commit Graph

95 Commits

Author SHA1 Message Date
Marcelo Fabri 0be8c855d2 Move functions to properties and Sets instead of Arrays 2017-10-04 14:34:00 -07:00
JP Simard c57c47d66f Remove unnecessary Swift version differences 2017-10-04 13:49:40 -07:00
Marcelo Fabri 81f90e6326 Add custom rule to enforce using queuedFatalError 2017-10-01 20:05:46 -03:00
Marcelo Fabri be341f90b9 Introduce queuedFatalError
`fatalError` prints the full path of the file, which leaks filesystem information from the machine that built the binary. Now that we release via CocoaPods, this is more critical.
2017-09-30 15:07:23 -03:00
Marcelo Fabri d21262d1bc Ignore SwiftLint commands in file_header rule
Fixes #1810
2017-09-30 00:29:23 -03:00
JP Simard 5c1c9389c7 produce an error when a 'disable' command doesn't silence any rules 2017-08-20 23:27:48 +02:00
Marcelo Fabri 70fc1a197d Ignore shebang in all rules
By making a creative use of regions.
Fixes #1294.
2017-07-26 00:24:23 +02:00
Marcelo Fabri 0bf1179c83 Validating trailing closure even if there's only one param 2017-07-24 00:50:31 +02:00
Marcelo Fabri 374731d92f Fix mark rule corrections generating invalid code in some cases
Apparently, we never invalidated the file cache when autocorrecting 😬
2017-07-23 02:08:15 +02:00
Marcelo Fabri 441bece9da Add extension_access_modifier rule 2017-06-02 21:24:55 +02:00
JP Simard 592537966c make Region & Command structs conform to Equatable 2017-05-24 11:33:39 -07:00
JP Simard bb50a4e8e5 fix overlapping commands causing incorrect Region generation
fixes #1388
2017-05-23 13:38:24 -07:00
Daniel Rodríguez Troitiño c29cf9a4d0 Avoid pattern matching false positives
The rule for unused optional binding was false triggering for pattern matching where the associated value was just an underscore. Additionally, pattern matching mixed with unused optional binding was not triggering in some cases.

New non triggering and triggering examples have been added for the failing cases, and new regular expressions are used to catch all the cases.

Modify the code in `File+SwiftLint` to expose full `NSTextCheckingResult` (and not just ranges) and rewire some pieces to use the new functions.

Fixes #1376
2017-04-06 14:16:12 -07:00
Keith Smiley b410c9376a Update optional interpolated strings for Xcode 8.3 2017-04-06 13:37:49 -07:00
JP Simard 8c4bfcc58d Merge branch 'master' into identifier-rule
* master: (44 commits)
  make valid_docs rule opt-in
  update LineLengthConfiguration.consoleDescription after #1264
  small refactoring after #1264
  fix for_where violation in CompilerProtocolInitRule.swift
  Add for_where rule
  explicitly set podspec dependency versions
  Add changelog entry
  Fix existing violations
  Navigate substructure even for different kinds
  Small style changes
  Modified so that kinds(forByteOffset:) does not require a separate filter() setup of the results
  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
  Fix false positive on large_tuple when using generics inside a tuple
  fix wording in changelog
  disable docs rules in Swift 2.3 and later
  Fix deadlock when stderr fills up OS buffer
  small Danger/oss-check improvements
  Fix links
  Fix cleanup
  Always use Xcode reporter on oss-check
  ...
2017-02-09 15:50:06 -08:00
JP Simard 69f885cf08 small refactoring after #1264 2017-02-09 14:42:09 -08: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 cd843e7fcd Added "ignores_comments" and "ignores_function_declarations" as boolean options to LineLengthRule 2017-01-30 17:51:56 -05:00
Marcelo Fabri 8715b913de PR feedback 2017-01-23 21:38:56 -02:00
Marcelo Fabri 44c55f4bde VariableNameRule is now IdentifierNameRule 2017-01-23 21:38:56 -02:00
JP Simard 29cdc86185 add some convenience members to SourceKit dictionaries 2017-01-22 11:00:57 -08:00
rakaramos 23a0d53424 Merge branch 'master' of github.com:realm/SwiftLint 2017-01-10 10:12:28 -02:00
JP Simard a291bb594a update SwiftLintFramework/Extensions to follow Swift 3 API Design Guidelines 2017-01-09 17:53:07 -08:00
rakaramos 147bfd6d5b Use range parameter if exists 2017-01-09 13:14:21 -02:00
Rafael Machado 14ea8a22d5 Add range to avoid whole file lookup 2017-01-07 16:28:04 -02:00
Marcelo Fabri 50535e7e5c Refactor regex functions to accept options
Fixes #1127
2017-01-06 21:04:15 -02:00
JP Simard da555b8a3b minor spacing fixes 2016-12-30 18:21:11 -08:00
Marcelo Fabri c6ac9b919c Add redundant_void_return rule
Fixes #1066
2016-12-26 01:01:04 -02:00
Marcelo Fabri 608a2725c8 Add class_delegate_protocol rule
Fixes #1039
2016-12-23 02:37:44 -02:00
Marcelo Fabri b18c98084c Fix existing violations 2016-12-22 11:57:06 -02:00
Marcelo Fabri 23a0b03fe8 Fixing violations 2016-12-19 21:20:58 -02:00
Marcelo Fabri 3f6ca7611a Fix violations 2016-12-19 20:08:17 -02:00
JP Simard 8b49cd36b5 Merge pull request #967 from marcelofabri/void-return-rule
Void return rule
2016-12-13 12:04:01 -08:00
JP Simard 3f7c010be8 fix specifying multiple rule identifiers in comment commands 2016-12-13 08:55:05 -08:00
Marcelo Fabri 7af7eb8fbe Handling curried declarations 2016-12-13 11:57:43 -02:00
JP Simard 31814c36c4 set result of two methods to _ to avoid warnings on Linux
also filed https://github.com/apple/swift-corelibs-foundation/pull/740
and https://github.com/apple/swift-corelibs-foundation/pull/741

to fix upstream
2016-12-11 14:04:49 -08:00
JP Simard 0faf567931 use bridge() rather than explict or implicit casts
this is a step in aligning the code to compile on both Darwin and
Linux
2016-12-11 13:47:44 -08:00
Marcelo Fabri 0afe9a8b19 Enabling more rules in SwiftLint itself 2016-12-10 19:12:40 -02:00
Marcelo Fabri 13b0cfe623 Fixing inconsistencies 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
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 39e1001629 make lots of Swift 3 related changes
many of which are to help with otherwise very long compile times
2016-12-01 00:34:29 -08:00
Norio Nomura 7c12a63e8f Merge commit '58eb0f69c4055bb2cb89b3df278eca6ce0fb1c34' into swift3.0
* commit '58eb0f69c4055bb2cb89b3df278eca6ce0fb1c34':
  generally clean up usage of swiftlint comment commands
  update README to reflect the ability to specify multiple rules in commands
  add changelog entry
  allow specifying multiple rule identifiers in comment commands

# Conflicts:
#	Source/SwiftLintFramework/Extensions/NSRegularExpression+SwiftLint.swift
#	Source/SwiftLintFramework/Models/Command.swift
#	Source/SwiftLintFramework/Rules/LegacyNSGeometryFunctionsRule.swift
#	Tests/SwiftLintFrameworkTests/ConfigurationTests.swift
#	Tests/SwiftLintFrameworkTests/IntegrationTests.swift
2016-11-30 18:42:40 +09:00
JP Simard e93eee31e7 generally clean up usage of swiftlint comment commands
used within the codebase itself.
2016-11-25 13:10:38 -08:00
JP Simard 639a18181c allow specifying multiple rule identifiers in comment commands 2016-11-25 12:56:48 -08: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
Norio Nomura 3ff76e7ce8 Update SourceKitten 2016-11-04 20:24:21 +09:00
Norio Nomura 21e3439bfa Merge pull request #766 from masters3d/no-autocorrect-disabled-rules
Added disable rule test to autocorrect
2016-10-29 14:09:11 +09:00
Norio Nomura 8bf15f1dba Migrate to Swift 3.0 2016-10-09 01:09:50 +09:00
J Cheyo Jimenez 8bed233282 added closure-spacing-rule 2016-09-03 21:10:33 -07:00