Commit Graph

5488 Commits

Author SHA1 Message Date
Marcelo Fabri 3a0973a7d3 Add back `tuple_pattern` rule
Fixes #3466
2022-04-16 23:09:30 -07:00
Marcelo Fabri a786e310a3
Add back return_value_from_void_function rule (#3882) 2022-04-16 16:53:11 -07:00
Danny Mösch 291b500269
Analyze all files listed in the command even if the `--path` option is used (#3951) 2022-04-15 10:36:29 -04:00
coffmark 564c6ddb55
Lint all files listed in the command even if the `--path` option is used (#3923) 2022-04-13 15:13:08 -04:00
Danny Mösch 870a7be2f4
Revert "Enable `typesafe_array_init` rule in repository" (#3948)
This reverts commit 42a2932883.

See #3942 for the reasons behind the revert.
2022-04-12 15:28:07 -04:00
JP Simard bdb548e1c0
Add a few more possible future Swift versions (#3946)
So tests don't fail on whatever the next Swift releases are.
2022-04-12 11:59:34 -04:00
coffmark 23fe6f4a39
[Test] fix Swift5.6.1 version (#3944) 2022-04-12 11:23:51 -04:00
Chris Hale 9beef23175
Throw error on bad expiring todo date format (#3626) 2022-04-11 21:20:05 +02:00
Danny Mösch 42a2932883
Enable `typesafe_array_init` rule in repository (#3942) 2022-04-10 11:42:58 -04:00
dependabot[bot] 5d7394be0e
Bump cocoapods-downloader from 1.4.0 to 1.6.3 (#3937)
Bumps [cocoapods-downloader](https://github.com/CocoaPods/cocoapods-downloader) from 1.4.0 to 1.6.3.
- [Release notes](https://github.com/CocoaPods/cocoapods-downloader/releases)
- [Changelog](https://github.com/CocoaPods/cocoapods-downloader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/CocoaPods/cocoapods-downloader/compare/1.4.0...1.6.3)

---
updated-dependencies:
- dependency-name: cocoapods-downloader
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-05 20:41:14 -04:00
Marcelo Fabri 0fbf010ea4
Only skip autocorrect on files with errors (#3933)
* Only skip autocorrect on files with errors

* Use other kind of warning so tests succeed on Linux

* Update CHANGELOG.md

Co-authored-by: JP Simard <jp@jpsim.com>

Co-authored-by: JP Simard <jp@jpsim.com>
2022-04-05 10:59:50 -07:00
JP Simard cb5fa0425d
Move Analyze CI job to Buildkite (#3919)
We now have two Buildkite agents thanks to a newly added M1 Mac mini
from MacStadium. Running the analyze job should be considerably faster
than the VMs that run on Azure Pipelines, although still slower than
if we were to run them with Xcode 13.2.1 because of the performance
regressions described in https://github.com/realm/SwiftLint/issues/3920.
2022-04-05 12:05:38 -04:00
JP Simard 5897598ba8
[CONTRIBUTING] Add CI section 2022-04-05 11:28:49 -04:00
JP Simard e92a3aeae9
fixup! fixup! Add `--in-process-sourcekit` command line flag 2022-03-31 12:49:12 -04:00
JP Simard 4c14678d77
fixup! Add `--in-process-sourcekit` command line flag 2022-03-31 11:42:42 -04:00
Juozas Valančius a28516d5e8
Create `.artifactbundle` during release 2022-03-31 09:52:22 -04:00
Juozas Valančius 62cc0f1a32
Add `--in-process-sourcekit` command line flag 2022-03-31 09:46:21 -04:00
JP Simard 89ebac11d5
Fix analyzer rules with Xcode 13.3 (#3921)
* Fix analyzer rules with Xcode 13.3

Looks like starting with Xcode 13.3 / Swift 5.6, cursor info requests
started canceling in-flight requests, so we need to pass
`key.cancel_on_subsequent_request: false` to bypass that.

Analyzer rules on Swift 5.6 are extremely slow, however. Not really
usable right now.

* Run analyzer rules one file at a time

* Add changelog entry
2022-03-28 11:58:34 -04:00
Danny Moesch fa2a0bab6c
Move StringView.byteOffset into generally accessible extension (#3917) 2022-03-25 07:27:50 +01:00
JP Simard a773c3ec21
Apply minor changes to the syntactic sugar rewrite (#3915)
* Improve docstrings for `StringView+SwiftSyntax.swift`
* Move changelog entry to correct section & reword
* Change parameter type from `Int` to `ByteCount`
* Move AbsolutePosition / ByteCount conversion to internal API
* Only warn once if syntax tree cannot be parsed
* Move Syntactic Sugar examples to a dedicated file
* Change SyntacticSugarRuleVisitor from SyntaxAnyVisitor to SyntaxVisitor
* Add `SugaredType` enum to help with the implement `SyntacticSugarRule`
2022-03-24 10:27:05 -04:00
JP Simard 9ace4bbb73
Don't pass `--path` to bundle install (#3918)
> [DEPRECATED] The `--path` flag is deprecated because it relies on
> being remembered across bundler invocations, which bundler will no
> longer do in future versions. Instead please use
> `bundle config set path 'vendor/bundle'`, and stop using this flag
2022-03-24 10:12:32 -04:00
Danny Moesch a801bbc83b
Add new type-safe ArrayInitRule (#3914)
The idea of this new Analyzer rule is to filter the calls of `map` before they are passed on to the classic ArrayInitRule which does the detailed checking of the lambda function block. The rule makes sure that only the `map` function is considered that is defined by the `Sequence` protocol.
2022-03-23 22:29:50 +01:00
JP Simard 83a86870bb
Fix false positives in `unused_closure_parameter` (#3916)
When using parameters with backticks.
2022-03-23 16:57:23 -04:00
Paul Taykalo d756541204
Rewrite SyntacticSugarRule using SwiftSyntax (#3866)
Rewrite SyntacticSugarRule with SwiftSyntax
2022-03-23 18:30:43 +02:00
JP Simard 206ff10e6e
Add empty changelog section 2022-03-23 11:34:40 -04:00
JP Simard e5791ec16c
release 0.47.0 2022-03-23 10:58:54 -04:00
Paul Taykalo 1616023b63
Add ability to run only one(focused) example (#3911)
* Add ability to focus on a specific test example

* Update CHANGELOG.md

Co-authored-by: JP Simard <jp@jpsim.com>

* Update CONTRIBUTING.md

Co-authored-by: JP Simard <jp@jpsim.com>

Co-authored-by: JP Simard <jp@jpsim.com>
2022-03-22 19:21:25 +02:00
JP Simard 702b36a781
Revert strip on Docker 2022-03-18 21:01:50 -04:00
JP Simard e06da98b6b
fixup! fixup! Strip binary when building for release 2022-03-18 20:54:07 -04:00
JP Simard a59be8092d
fixup! Strip binary when building for release 2022-03-18 20:44:53 -04:00
JP Simard 91b58c6cbe
Strip binary when building for release
Shaves ~32% off the binary size.

Brings the universal fat binary on macOS from 86MB to 58MB.
2022-03-18 20:43:55 -04:00
Danny Moesch 12cda68ce2
Fix some typos and improve wording/style (#3910) 2022-03-18 17:42:25 -04:00
JP Simard 24bf129268
Run OSSCheck when Package.swift changes (#3909) 2022-03-18 17:13:21 -04:00
JP Simard a256fa2c8c
Bump SwiftSyntax to latest release (#3907)
Fixes https://github.com/realm/SwiftLint/issues/3906

Going from 0.50600.0 to 0.50600.1
2022-03-18 11:59:35 -04:00
JP Simard 21bb280068
Build additional Docker image with Swift 5.5 (#3904)
* Build additional Docker image with Swift 5.5
* Build `swiftlint_linux_swift_5_5.zip`
2022-03-17 17:27:05 -04:00
JP Simard c44a3f4ff9
Add a changelog entry for `IN_PROCESS_SOURCEKIT` 2022-03-17 15:06:24 -04:00
JP Simard 402fe69f59
Add changelog entry for `IN_PROCESS_SOURCEKIT` 2022-03-17 15:05:11 -04:00
JP Simard 87d21e44e6
Edit wording in build phase Homebrew instructions 2022-03-17 13:31:04 -04:00
Michael Henry a129163053
Update applesilicon x brew fix Instruction (#3903) 2022-03-17 13:22:09 -04:00
JP Simard de3569cb3b
Update SwiftSyntax to 0.50600.0 (#3901)
Uses SwiftSyntax 5.5 on Linux when building with Swift 5.5. We use the 5.6 version of
SwiftSyntax when building with Swift 5.5 and 5.6 on macOS because we statically link
`lib_InternalSwiftSyntaxParser` thanks to
https://github.com/keith/StaticInternalSwiftSyntaxParser/releases/tag/5.6.

This keeps SwiftLint binaries portable across machines on macOS, regardless of
_where_ or even _if_ `lib_InternalSwiftSyntaxParser` is installed.

* Run TSan CI job with `--configuration release` to avoid stack overflows
* Add Swift 5.6 CI job
* Fix linker settings
2022-03-17 13:19:48 -04:00
JP Simard ca2712aaee
Make linux zip from GitHub's remote Docker image
Locally I had trouble building the image on both my previous Intel MacBook Pro
and my new M1 Max MacBook Pro.
2022-03-16 11:05:09 -04:00
Marcelo Fabri 0e5d838765
Support #unavailable in deployment_target rule (#3898)
Fixes #3896
2022-03-16 10:41:04 -04:00
JP Simard 84bc2174af
Bump dependencies (#3900)
SourceKitten: 0.31.1 to 0.32.0
SWXMLHash: 5.0.2 to 6.0.0

Also prevent swift-argument-parser from being updated to 1.1.0 which is
incompatible with our macOS version support.
2022-03-15 17:17:42 -04:00
Marcelo Fabri db2721f78e
Require Swift 5.0 in runtime (#3886)
* Require Swift 5.0 in runtime

* Fix violation

* Enable legacy_rule by default

* Update changelog

* Fix changelog after rebase

* More cleanup
2022-03-11 14:01:27 -08:00
JP Simard c664c4f9e6
Move Buildkite pipeline config to repo (#3893)
These were previously defined in Buildkite itself.
2022-03-11 16:27:17 -05:00
JP Simard 1abc50304c
Use alternate implementation of glob with globstar support (#3892)
Adapted from https://gist.github.com/efirestone/ce01ae109e08772647eb061b3bb387c3

The implementation from Pathos seems buggy.

Fixes https://github.com/realm/SwiftLint/issues/3891
2022-03-11 13:24:39 -05:00
Fumito Nakazawa 2ae22d06a2
Support recursive globs (#3843)
ref: https://github.com/realm/SwiftLint/issues/3789

## Overview
Support glob recursive by using [Pathos](https://github.com/dduan/Pathos)
- Introduce Pathos
- Replace glob logic
- Fix some test cases
2022-03-10 21:56:43 -05:00
JP Simard 92e199649d
Fix make package command (#3890) 2022-03-10 20:00:49 -05:00
JP Simard 3273cef42b
Prevent empty files from triggering rule violations (#3885)
There are many valid cases to have an empty Swift source files, and these
shouldn't trigger violations.
2022-03-09 16:09:11 -05:00
JP Simard eeba297f33
[Docs] Remove "experimental" label for analyzer rules (#3884)
These have been fairly stable for over two years at this point.
2022-03-09 14:45:09 -05:00