5041 Commits
Author SHA1 Message Date
JP Simard 4f8b7a5f48 release 0.40.3 0.40.3 2020-09-22 17:22:18 -04:00
Frederick Kellison-Linn 64b309e19e Fix false positives for 'multiple_closures_with_trailing_closure' (#3353) 2020-09-22 14:18:50 -07:00
JP Simard 494796b526 [UnusedDeclarationRule] Work around SR-11985 (#3363) 2020-09-22 10:00:16 -07:00
JP Simard a67b0f26e7 Revert "Fix finding the nested config when a single file path is passed (#3342)" (#3362)
This reverts commit ea06b79e0d.
2020-09-22 08:30:52 -07:00
JP Simard 774267c436 [CONTRIBUTING] Add building & running tips (#3360)
* [CONTRIBUTING] Add building & running tips

* fixup! [CONTRIBUTING] Add building & running tips
2020-09-22 10:44:11 -04:00
Seth Friedman ea06b79e0d Fix finding the nested config when a single file path is passed (#3342)
Fixes #3341

When SwiftLint searches for nested configurations and only one file has been passed in via the `paths` argument, SwiftLint returns early after inadvertently comparing the containing directory of the file-to-be-linted to itself. This happens because `rootDirectory` is calculated from `rootPath`, which is set to the file being linted in this scenario.
2020-09-22 07:24:52 -07:00
Seth Friedman 7db31658cb Include Linux zip in list of GitHub release binaries (#3350)
* Include Linux zip in list of GitHub release binaries

This matches what has been included in recent releases.

* Fix one more Linux zip reference

* Use all 1s for the numbered list in Releasing.md

Markdown renders the numbered list correctly, and this way one can easily reorder the steps
or add new steps without needing to renumber everything.
2020-09-22 07:01:55 -07:00
JP Simard f71394a372 [UnusedDeclarationRule] Add more tests (#3359) 2020-09-21 12:10:46 -07:00
JP Simard 59d6c2ef52 Test CI with official Swift 5.3 release (#3356) 2020-09-20 11:16:10 -04:00
JP Simard 0ecf9a945b Don't mark @NSApplicationMain or @UIApplicationMain classes as unused (#3355) 2020-09-20 07:16:26 -07:00
hank121314 5e537fa821 [Fix] UnusedCaptureListRule: implicit self in @escaping closures (#3352)
## Summary

This pr fixes: #3267 .

Since Swift 5.3 is released. It support implicit self in @escaping closures([SE-0269](https://github.com/apple/swift-evolution/blob/master/proposals/0269-implicit-self-explicit-capture.md))

I think we should exclude self keyword from capture list rule.

## Test Plan

I have already add some test in example.

Thanks you so much for your code review!
2020-09-18 07:26:49 -07:00
JP Simard 6d2e8cfc06 Skip correcting files with parser diagnostics (#3349)
* Skip correcting files with parser diagnostics

Also fix many rule examples with parser diagnostics.

* Sourcery

* Link to issue in changelog entry
2020-09-17 18:14:00 -04:00
JP Simard 9b93b3efb8 [SwiftLintFile] Remove lock in favor of UUID (#3347)
We were using this lock to guarantee a new ID for every file, but we can
get that benefit by using values that are guaranteed to be unique
without the need for locks, such as a UUID.
2020-09-17 07:35:05 -07:00
JP Simard ea311bab23 [UnusedDeclarationRule] Speed up and detect more dead code (#3340)
By using SourceKit's `index` request to index the entire source file,
we can avoid having to make `cursor-info` requests for every candidate
token in the file, which scales linearly with the number of candiate
tokens.

For the Yams project, this approach improved the total SwiftLint run
time by 4.6x: 7.9 down from 36.8s.

The SourceKit index response doesn't have everything we need to identify
declarations, so we still need to make some `cursor-info` requests,
mostly to detect overrides: protocol conformances and parent class
overrides.

This approach ends up finding more unused declarations because the index
contains more declared USRs than can be found by calling `cursor-info`
on candidate tokens in a file.

---

Remove unused declaration in ArrayInitRule

---

Update package versions
2020-09-15 10:33:27 -07:00
JP Simard d9ce579b38 Add empty changelog section 2020-09-10 22:41:13 -04:00
JP Simard 9ab72060b6 release 0.40.2 0.40.2 2020-09-10 22:25:10 -04:00
JP Simard 7009463876 Format changelog 2020-09-10 21:15:07 -04:00
Ryan Demo 51544bb4cc Add excluded_match_kinds custom rule config parameter (#3336)
This allows custom rules to define an `excluded_match_kinds` array instead of listing out all but one or a few of the `SyntaxKind`s in `match_kinds`. Rules that include both `match_kinds` and `excluded_match_kinds` will be invalid, since there's not an obvious way to resolve the two without an arbitrary priority between them.
2020-09-10 21:08:41 -04:00
JP Simard 4083f16885 Merge pull request #3331 from lightsprint09/patch-1
Use correct term for associated values
2020-09-03 07:37:34 -07:00
JP Simard 89981cc984 Merge pull request #3330 from realm/add-linux-binary-to-release-artifacts
Add Linux binary to release artifacts
2020-09-03 06:18:16 -07:00
Lukas Schmidt 96c8918982 Update CHANGELOG.md 2020-09-03 12:23:34 +02:00
Lukas Schmidt 8945038087 Use correct term for associated values
See https://docs.swift.org/swift-book/LanguageGuide/Enumerations.html for reference
2020-09-03 11:26:57 +02:00
JP Simard d0d9ad575f Add Linux binary to release artifacts
There are a lot of libraries dynamically linked, so it's unlikely to
work in most places other than the same Docker image used to build the
binary (latest official Swift Docker image).

It might still be useful if you can guarantee that you'll use this from
that image.

    ldd .build/release/swiftlint
      linux-vdso.so.1 (0x00007fff38db5000)
      libswiftCore.so => /usr/lib/swift/linux/libswiftCore.so (0x00007f11503cd000)
      libFoundation.so => /usr/lib/swift/linux/libFoundation.so (0x00007f114fba6000)
      libswiftGlibc.so => /usr/lib/swift/linux/libswiftGlibc.so (0x00007f1151264000)
      libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f114f987000)
      libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f114f784000)
      libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f114f580000)
      libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f114f1e2000)
      libswiftDispatch.so => /usr/lib/swift/linux/libswiftDispatch.so (0x00007f115122b000)
      libdispatch.so => /usr/lib/swift/linux/libdispatch.so (0x00007f114ef82000)
      libBlocksRuntime.so => /usr/lib/swift/linux/libBlocksRuntime.so (0x00007f114ed7f000)
      libFoundationXML.so => /usr/lib/swift/linux/libFoundationXML.so (0x00007f11511d2000)
      libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f114e98e000)
      libicui18nswift.so.65 => /usr/lib/swift/linux/libicui18nswift.so.65 (0x00007f114e463000)
      libicuucswift.so.65 => /usr/lib/swift/linux/libicuucswift.so.65 (0x00007f114e062000)
      libicudataswift.so.65 => /usr/lib/swift/linux/libicudataswift.so.65 (0x00007f114c3b3000)
      libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f114c02a000)
      libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f114be12000)
      /lib64/ld-linux-x86-64.so.2 (0x00007f1151053000)
      librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f114bc0a000)
      libxml2.so.2 => /usr/lib/x86_64-linux-gnu/libxml2.so.2 (0x00007f114b849000)
      libicuuc.so.60 => /usr/lib/x86_64-linux-gnu/libicuuc.so.60 (0x00007f114b491000)
      libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f114b274000)
      liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f114b04e000)
      libicudata.so.60 => /usr/lib/x86_64-linux-gnu/libicudata.so.60 (0x00007f11494a5000)
2020-09-02 15:33:46 -04:00
JP Simard 2ea422b52a Add empty changelog section 2020-08-27 11:52:50 -04:00
JP Simard 1a1db6c706 release 0.40.1 0.40.1 2020-08-27 11:33:45 -04:00
JP Simard ff0e9f46c0 Merge pull request #3319 from realm/update-sourcekitten-and-yams
Update SourceKitten and Yams
2020-08-24 20:56:15 -07:00
JP Simard 81e8501dd5 Update SourceKitten and Yams 2020-08-24 22:27:13 -04:00
JP Simard e677737fe6 Merge pull request #3313 from realm/ks/add-support-for-params-files-for-file-path-arguments
Add support for params files for file path arguments
2020-08-21 08:13:06 -07:00
Keith Smiley eb841988f9 Add empty args 2020-08-20 11:32:05 -07:00
Keith Smiley 32579f457a Add support for params files for file path arguments
This allows you to pass `@path/to/file` which will be read line by line
for the list of files to lint / analyze. This is useful if you want to
pass a massive list of files which will either exceed arg max, or
break most unix tools if you use script input files + env vars.
2020-08-20 11:20:09 -07:00
JP Simard e90d2e2005 Merge pull request #3309 from ZevEisenberg/patch-1
Explain why two trailing spaces are needed
2020-08-18 10:57:32 -07:00
Zev Eisenberg 5a1693c6aa Less forceful language. 2020-08-18 11:32:23 -04:00
Zev Eisenberg 93527bc9b8 Explain why two trailing spaces are needed. 2020-08-18 11:23:26 -04:00
JP Simard af2837e3e5 Merge pull request #3298 from cfiken/fix-swift-version
Fixed .swift-version with Swift 5.1
2020-08-13 07:46:40 -07:00
JP Simard c3b5bc186e Merge branch 'master' into fix-swift-version 2020-08-13 07:46:08 -07:00
JP Simard 7feb50f0df Merge pull request #3299 from cfiken/fix_swift_version_test
Update test `testDetectSwiftVersion` for Swift 5.2.5
2020-08-13 07:44:50 -07:00
cfiken 1b95821205 Fix: testDetectSwiftVersion for Swift 5.2.5 2020-08-13 12:48:33 +09:00
cfiken 776b7d74e2 Fix: CHANGELOG 2020-08-13 12:33:14 +09:00
cfiken 2418534ce5 Fix: .swift-version with Swift 5.1 2020-08-13 12:16:28 +09:00
Marcelo Fabri 0e8ad1d169 Update CHANGELOG.md 2020-08-10 09:43:13 -07:00
Marcelo Fabri da66a81710 release 0.40.0 0.40.0 2020-08-10 08:23:58 -07:00
Marcelo Fabri 83f52704f4 Merge pull request #3292 from realm/marcelo/unneeded_notification_center_removal
Add `unneeded_notification_center_removal` rule
2020-08-10 08:17:29 -07:00
Marcelo Fabri 5e1c13be52 Add unneeded_notification_center_removal rule
Fixes #2755
2020-08-10 07:46:51 -07:00
Marcelo Fabri 6a8f413bd7 Merge pull request #3291 from realm/marcelo/codecov
Setup codecov
2020-08-10 02:11:41 -07:00
Marcelo Fabri 6cf3534db9 Setup codecov 2020-08-10 01:41:32 -07:00
Marcelo Fabri 5ae6a32944 Merge pull request #3289 from realm/dependabot/bundler/kramdown-2.3.0
Bump kramdown from 2.1.0 to 2.3.0
2020-08-08 16:38:13 -07:00
dependabot[bot] bf834b6ff4 Bump kramdown from 2.1.0 to 2.3.0
Bumps [kramdown](https://github.com/gettalong/kramdown) from 2.1.0 to 2.3.0.
- [Release notes](https://github.com/gettalong/kramdown/releases)
- [Changelog](https://github.com/gettalong/kramdown/blob/master/doc/news.page)
- [Commits](https://github.com/gettalong/kramdown/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-07 23:28:37 +00:00
Marcelo Fabri 1dbe1f23f0 Merge pull request #3153 from realm/mf-bugfix-3150
Fix false positives in extension_access_modifier with Swift 5.2
2020-08-05 22:14:41 -07:00
Marcelo Fabri 4756ce6b69 Ignore local vars and params 2020-08-05 21:46:33 -07:00
Marcelo Fabri bb372c2146 Fix false positives in extension_access_modifier with Swift 5.2 2020-08-05 21:36:09 -07:00