Commit Graph

30 Commits

Author SHA1 Message Date
JP Simard 3a2bb15ca3
Make some SwiftLintFramework declarations public (#4945)
* Make some SwiftLintFramework declarations public

If built-in rules depend on them.

This will allow separating the rules from the core infrastructure in
separate modules in an upcoming PR.

It also helps formalize the API contract for what should be accessible
to rule implementations.

* Exclude extensions from jazzy
2023-04-26 16:37:25 -04:00
Ryan Aveo 92304cdd98
Fix building tests in Xcode (#4607)
Co-authored-by: JP Simard <jp@jpsim.com>
2022-11-30 10:33:33 -05:00
JP Simard 18f9a0e3a6
Write some docs for internal APIs (#4550)
These should be useful when writing rules, but also may become public
API in the future.
2022-11-16 13:58:55 -05:00
Danny Mösch 7e8a3ae2ac
Introduce `onlyElement` property on `Collection` (#4518) 2022-11-06 07:37:44 -05:00
JP Simard 7624059caa
Rewrite `unused_closure_parameter` with SwiftSyntax (#4371) 2022-10-14 03:35:51 -04:00
Frederick Pietschmann 495d742f65 Fix issues originating from new set semantics 2020-11-21 00:05:42 +01:00
Paul Taykalo 693ee2cae9
Add Isnot Empty extension in the Swift Framework (#3387) 2020-11-07 18:42:55 -05:00
Paul Taykalo 61a6a278a5 add byterange to the dictionary and breadthfirst algorithm 2019-11-10 23:53:59 +02:00
Paul Taykalo 73802c285d Add own wrappers over syntax tokens and syntax map 2019-11-10 22:55:54 +02:00
Elliott Williams 7344732799 PR: Create File+Hashable, symlink Array+SwiftLint, fix nits 2019-07-18 14:59:42 -07:00
Elliott Williams 512e06a4e4 Update tests to compile and pass
Publicize Array extensions

Address linting violations
2019-07-18 14:59:42 -07:00
JP Simard 18c78684b0
Remove unused declarations (#2816) 2019-07-18 13:52:57 -07:00
Paul Taykalo f1fd6cec3a Update group Array extension to faster implementation (#2654) 2019-02-20 19:33:19 -08:00
Marcelo Fabri 7b84e2bf66 Extract two common operations to extensions 2019-01-24 21:14:10 -08:00
JP Simard d1109da326
Parallelize iterating over subpaths (#2475)
This has a very small performance improvement on multi-core machines
2018-11-21 22:38:05 -08:00
JP Simard b83e0991b9
Remove all file headers
The MIT license doesn't require that all files be prepended with this
licensing or copyright information. Realm confirmed that they're ok with this
change. This will enable some companies to contribute to SwiftLint and the
date & authorship information will remain accessible via git source control.
2018-05-04 13:42:02 -07:00
Norio Nomura 2a0ac455bc
'flatMap' is deprecated: renamed to 'compactMap(_:)' 2018-04-08 13:28:09 +09:00
Norio Nomura 85542a6f8d
Remove `DispatchQueue.sync` from `Array.parallelMap`
`DispatchQueue.sync` was required to avoid CoW on calling `subscript` from multiple copied instances of `Array`.
Since `UnsafeMutableBufferPointer` does not cause CoW on same situation, `DispatchQueue.sync` can be removed.
2018-03-08 15:56:28 +09:00
JP Simard a7a8a69fa2
Improve Array.parallelMap
By applying concepts from Swift Talk 90: https://talk.objc.io/episodes/S01E90-concurrent-map

Notably:
* Removing `@escaping` from block parameter
* Avoiding Array.append & sorting
* Using a constant DispatchQueue label
2018-03-07 09:27:35 -08:00
Marcelo Fabri d9eda655bf PR feedback 2017-01-02 17:49:54 -02:00
JP Simard 53d0cf6975
fix incorrect flatMap usage to use map instead 2017-01-02 09:47:48 -08:00
JP Simard 8774a921a6
use DispatchQueue.concurrentPerform rather than rolling our own
also remove parallelForEach from SwiftLintFramework's public interface
since calling the GCD API is almost as concise and avoids polluting the
public API.

Finally, also remove the "fast" path for parallelMap since GCD should
do the reasonable thing for us here.
2016-12-31 17:06:02 -08:00
JP Simard 28813fce08
extend Array with parallelMap, parallelFlatMap and parallelForEach 2016-12-30 23:08:23 -08:00
JP Simard a50a0bee06
move array(of:) into other unconstrained Array extension 2016-12-30 18:21:11 -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 0b481f1e16
change Array.arrayOf(_:) to Array.array(of:) 2016-12-01 18:09:38 -08:00
Norio Nomura 8bf15f1dba
Migrate to Swift 3.0 2016-10-09 01:09:50 +09: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
Scott Hoyt 647371517e Extracted arrayOf to Array extension and used to simplify VariableNameMinLengthRule.init?(config:). 2016-01-11 13:10:17 -08:00