Commit Graph

1324 Commits

Author SHA1 Message Date
JP Simard 5b98fbe2f6 make Command.swift compile on Linux
by addressing differences in APIs between Scanner on Linux and Darwin.
2016-12-11 14:04:49 -08:00
JP Simard 8c171458f8 make QueuedPrint.swift compile on Linux
by adding an explicit `import Dispatch` and disabling the `atexit_b` call
on Linux. This just means that we won't be able to guarantee that the print()
buffer will have been flushed at program exit. Hopefully this doesn't
cause too many issues.
2016-12-11 14:04:49 -08:00
JP Simard 876aa26a1d add type aliases for NSRegularExpression and NSTextCheckingResult
to align Linux and Darwing code.
2016-12-11 14:04:49 -08:00
JP Simard da1d0ba876 make FileManager.filesToLintAtPath(_:) compile on Linux
by addressing differences in FileManager APIs on Linux and Darwin
2016-12-11 14:04:49 -08: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 a5a1ed7a70 don't omit options param in NSRegularExpression calls
since these aren't optional on Linux, so this will help align
cross-platform code.
2016-12-11 14:04:49 -08:00
JP Simard 05fc8f3110 Merge pull request #962 from realm/jp-casts-refactor-file-header-configuration
eliminate needless conditional casts in FileHeaderConfiguration
2016-12-11 14:03:25 -08:00
JP Simard 43edeeba25 eliminate needless conditional casts in FileHeaderConfiguration 2016-12-11 13:48:41 -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
Daniel Duan b9835c3828 Add rule to ban dynamic inline functions
When a class method is marked as both `dynamic` and `@inline(__always)`, its
dispatch behavior is not well defined. Therefore this specific combination
should be discouraged.
2016-12-11 01:52:39 -08:00
Daniel Duan 00bfe3c77e abstract attribute retrieval from SourceKit
Extracting attribute values enclosed in SourcKit dictionary is common enough to
warrant a utility function.
2016-12-11 01:51:33 -08:00
JP Simard bda2b45c09 Merge pull request #958 from marcelofabri/empty-parentheses-closure
Add empty_parentheses_with_trailing_closure rule
2016-12-10 22:37:07 -08:00
JP Simard 7e1af50dc6 parentheses 2016-12-10 22:34:04 -08:00
Marcelo Fabri 0209c461b3 Add empty_parentheses_with_trailing_closure rule
Fixes #885
2016-12-11 02:33:23 -02:00
Marcelo Fabri 0afe9a8b19 Enabling more rules in SwiftLint itself 2016-12-10 19:12:40 -02:00
Marcelo Fabri 09fb1eb93e Fix false negatives in AttributesRule 2016-12-09 19:39:25 -02:00
Marcelo Fabri 2ddf7757d7 Merge branch 'master' into attributes-rule 2016-12-09 14:50:48 -02:00
Marcelo Fabri 205c308100 Merge pull request #904 from marcelofabri/file-header-rule
Add FileHeaderRule
2016-12-09 01:22:58 -02:00
JP Simard 52c025b866 Merge pull request #950 from marcelofabri/redundant-enum
Add RedundantStringEnumValueRule
2016-12-08 14:55:23 -08:00
JP Simard 43380cefe0 refactor RedundantStringEnumValueRule.swift
to consolidate duplicate code and generally simplify the code
2016-12-08 13:33:05 -08:00
Marcelo Fabri 819a5439db Fix header format 2016-12-08 18:32:21 -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 1c59d8fb6e Updating rule description 2016-12-08 18:29:57 -02:00
Marcelo Fabri 4b67f683df Improve location report 2016-12-08 18:29:57 -02:00
Marcelo Fabri 9f1294abfc Make it green 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
Marcelo Fabri 4abe67c7d7 Add FileHeaderRule
Fixes #844
2016-12-08 18:29:57 -02:00
Marcelo Fabri a7c58c14d4 Add RedundantStringEnumValueRule
Fixes #946
2016-12-08 18:26:45 -02:00
JP Simard cd632bc106 fix silly typo 2016-12-08 12:13:11 -08:00
JP Simard d113d3b091 help type inference in Legacy* rules 2016-12-08 02:05:10 -08:00
JP Simard 971873e730 speed up compilation of OperatorFunctionWhitespaceRule.validateFile(_:) 2016-12-08 01:58:40 -08:00
JP Simard a57526d639 omit 'self.' references when not ambiguous 2016-12-08 01:25:54 -08:00
JP Simard f056cc964b refactor and simplify EmojiReporter 2016-12-07 23:49:13 -08:00
JP Simard b409a056e5 refactor Array.unique and Array.group(by:) 2016-12-07 23:26:43 -08:00
Michał Kałużny d97632e52d Add human readable reporter that’s also funny because emoji. 2016-12-07 23:13:59 -08:00
JP Simard fa2628a702 Merge pull request #942 from realm/ignore-parameters-count-init
Ignore parameters count init
2016-12-07 23:01:09 -08:00
JP Simard f0804fa51c fix some false positives in detecting for initializers
in function_parameter_count
2016-12-07 16:24:54 -08:00
Marcelo Fabri 785d204397 Merge pull request #935 from marcelofabri/weak-delegate-in-protocol
Skip declarations in protocols in weak_delegate rule
2016-12-07 22:00:06 -02:00
Denis Lebedev 427a0c3b6f Replace contains with hasPrefix 2016-12-07 15:58:43 -08:00
Denis Lebedev 74ae00b1c7 Ignore initializers parameter count 2016-12-07 15:57:18 -08:00
Marcelo Fabri 7e4d30bf38 Skip declarations in protocols in weak_delegate rule 2016-12-07 00:42:44 -02:00
Marcelo Fabri 0fb4c6d691 Handling signals 2016-12-06 22:09:34 -02:00
Marcelo Fabri 2340056932 Handling exponentials 2016-12-06 22:00:19 -02:00
Marcelo Fabri 00a891ad29 Handle other formats than decimal 2016-12-06 21:52:24 -02:00
Marcelo Fabri 27456823e3 Add number_separator opt-in rule
Fixes #924
2016-12-06 00:17:28 -02: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
Philip Webster 340f78c6b3 omit trailing commas 2016-12-03 14:41:22 -08:00