Commit Graph

6193 Commits

Author SHA1 Message Date
JP Simard b0e61af98b
Use Bazel to build Docker image 2023-04-24 16:09:57 -04:00
JP Simard 3b309ad1af
Publish a multi-platform Docker image
Addresses https://github.com/realm/SwiftLint/issues/4531
2023-04-24 16:09:57 -04:00
JP Simard 817de197d5
Clean up `MARK` comments 2023-04-24 15:13:44 -04:00
JP Simard 214a749ace
Extend the custom rules section in the README (#4926)
To link to a video tutorial and example project for creating custom
rules written in Swift and to outline some of the advantages to using
these over regex custom rules.
2023-04-24 17:04:56 +00:00
JP Simard fd4f9afb08
Remove AppCode section in README.md (#4925)
> AppCode is no longer available as a commercial product as of
> December 14, 2022.

From https://blog.jetbrains.com/appcode/2022/12/appcode-2022-3-release-and-end-of-sales-and-support/
2023-04-24 12:44:49 -04:00
Danny Mösch c241935635
Introduce basic Stack type (#4922) 2023-04-23 09:12:35 +00:00
JP Simard 46ff727a13
Update Bazel version to 6.1.2 (#4918) 2023-04-21 17:00:53 -04:00
JP Simard dc89109622
Apply suggested bazel flags (#4917) 2023-04-21 16:51:14 -04:00
JP Simard 9c2525139a
Update CryptoSwift to 1.7.1 (#4916)
To fix Swift 5.8 warnings
2023-04-21 14:15:44 +00:00
JP Simard d601917e40
Apply minor changelog edits 2023-04-21 09:25:11 -04:00
YoungBin Lee 498b4c8fbe
Correct organization name in README files (#4913)
Rename 'Ray Wenderlich' to 'Kodeco'.
2023-04-21 05:16:13 +00:00
Danny Mösch 69fadb6918
Remove no-op initializers from structs (#4912) 2023-04-20 11:59:37 +02:00
JP Simard f866ec32b1
Add link to video tutorial demonstrating how to write a rule (#4910)
https://vimeo.com/819268038
2023-04-19 17:16:27 -04:00
JP Simard 6d51459323
Update Ruby Gems (#4909)
* danger: 8.6.1 -> 9.2.0
* cocoapods: 1.11.3 -> 1.12.1
* jazzy: 0.14.2 -> 0.14.3
2023-04-19 10:23:21 -04:00
JP Simard 21dc766c93
Exclude new `XCTSpecificMatcherRule` examples from documentation (#4907) 2023-04-18 21:45:51 +00:00
JP Simard 0f802f766a
[CI] Remove `update_swift_syntax.yml` (#4906)
We now manually update SwiftSyntax as needed.
2023-04-18 21:35:43 +00:00
JP Simard fbbccf9db8
Allow configuring `xct_specific_matcher` with matchers (#4905)
So that either `one-argument-asserts` or `two-argument-asserts` or both
can be enabled.

The following configuration effectively reverts back to the rule
behavior prior to https://github.com/realm/SwiftLint/pull/3858:

```yaml
xct_specific_matcher:
  matchers:
    - two-argument-asserts
```
2023-04-18 20:50:58 +00:00
JP Simard 8b72eb0406
Mark `bazel_skylib` as `dev_dependency = True` (#4904)
So folks who integrate SwiftLint with Bazel don't need to match this
exact version.
2023-04-18 18:50:56 +00:00
JP Simard c22d60fac0
Update `UnusedImportRuleExamples` for Swift 5.8 (#4903) 2023-04-18 17:58:40 +00:00
Keith Smiley 1892c846b0
Workaround dyld warning about SwiftSyntax classes (#4901)
This uses a recent but unannounced (also read as private) feature of
dyld where it ignores duplicate Objective-C classes when they're in a
special format in the binary. c8a445f88f/dyld/PrebuiltLoader.cpp (L1660-L1662)

I think this is generally safe because hopefully people aren't actually
using the SwiftSyntax classes through the Objective-C runtime, but if
they are we'd still probably prefer to silence the noise and accept the
UB.

Fixes https://github.com/realm/SwiftLint/issues/4782
2023-04-17 19:55:33 -04:00
Andrew Montgomery 41290a23d3
Remove checks for setUp/tearDown from `overridden_super_call` rule (#4875) 2023-04-17 20:18:41 +00:00
Frad LEE 5814ec1a1a
Add architecture detection to Xcode script configuration (#4873) 2023-04-17 18:48:06 +00:00
JP Simard f9b0e9f0af
Update CryptoSwift to 1.7.0 (#4899) 2023-04-17 10:37:40 +00:00
Keith Smiley 3ef44cf742
Switch to SwiftPM conditional dependencies API (#4003)
This API allows us to mostly remove `#if` conditionals which enables
cross compilation from macOS -> Linux. It also removes the thrashing of
Package.resolved if you compile in a docker image.
2023-04-16 20:19:25 +02:00
Danny Mösch 5aed7ce95c
Check first argument label in `reduce_boolean` rule (#4895) 2023-04-16 09:58:27 +02:00
Martin Redington 97fd216455
Skip unit tests in `no_magic_numbers` rule (#4897) 2023-04-16 09:07:54 +02:00
Danny Mösch f127ba14dd
Ignore block comments in `let_var_whitespace` rule (#4889) 2023-04-16 00:10:03 +02:00
JP Simard 74b82daba0
[CI] Use rbenv to manage Ruby (#4893)
And pin the Ruby version to 2.7.5. rbenv was installed on all CI
machines using Homebrew, with Ruby 2.7.5 installed and set as the
global version. The `pre-command` script was also updated on all agents
to add rbenv binaries to the path and run `rbenv init`.

Remove rules_ruby integration and just use rbenv and ruby directly.
2023-04-14 16:23:05 +00:00
JP Simard 8c617d7412
[CI] Update Azure Pipelines to run with Swift 5.8 (#4890)
Linux only because Azure Pipelines doesn't have any
images with macOS 13 or Xcode 14.3 yet.
2023-04-14 14:27:03 +00:00
JP Simard a4f4680442
Update copyright year for html docs 2023-04-14 10:18:47 -04:00
JP Simard 62b2914271
Update rules_ruby (#4891)
Just to stay up to date.
2023-04-14 10:11:50 -04:00
JP Simard 1b0f37c6f6
Pin Sourcery version to 2.0.2 (#4888)
By adding a `tools/sourcery` script that downloads and runs Sourcery via
Bazel.

Previously, unrelated changes might include modifications to the
generated comment headers because contributors' local versions of
Sourcery would be used, which we don't control.

Also move the CI job to Buildkite where the bazel server is usually
already warmed up and running.
2023-04-13 20:09:26 +00:00
JP Simard 5226725689
Fix extra space before member access 2023-04-13 15:12:37 -04:00
JP Simard e361e14c90
Move changelog entry to the latest section 2023-04-13 15:04:13 -04:00
JP Simard 70a56a1420
Update SwiftSyntax to 04-10 snapshot (#4887)
https://github.com/apple/swift-syntax/releases/tag/509.0.0-swift-5.9-DEVELOPMENT-SNAPSHOT-2023-04-10-a
2023-04-13 14:04:43 -04:00
Gabriel Féron 409f117da9
Use Ubuntu 20.04 to release Linux binaries (#4882)
* Use Ubuntu 20.04 to release Linux binaries

Using the latest version of Ubuntu leads to incompatibilities with `glibc` versions from LTS versions.

* Use Ubuntu 20.04 for Azure pipelines
2023-04-13 13:25:43 -04:00
JP Simard 7fe7bb28d9
Update rules_xcodeproj to 1.4.0 (#4885)
https://github.com/MobileNativeFoundation/rules_xcodeproj/releases/tag/1.4.0
2023-04-13 15:25:17 +00:00
Danny Mösch bb11e6a0a7 Extract examples to separate file 2023-04-04 20:10:59 +02:00
Danny Mösch eee97a7b2b Trigger `prefer_self_in_static_references` rule on types 2023-04-04 20:10:59 +02:00
Danny Mösch cf1e2e27dc Use `is` instead of `as` for simple type checks 2023-04-04 20:10:59 +02:00
Sven Münnich a2facce70c
Fix false positives related to multiline strings in `indentation_width` rule (#4862) 2023-04-04 19:27:16 +02:00
Danny Mösch bd444fcd77
Fix `lower_acl_than_parent` rule rewriter by preserving leading whitespace (#4861) 2023-04-03 20:26:46 +00:00
Danny Mösch ee849bcb10
Remove unused imports (#4856) 2023-04-03 19:26:59 +02:00
Danny Mösch 6d4bc78cb4
Add new `superfluous_else` rule (#4696) 2023-04-02 12:32:40 +02:00
Danny Mösch 16e2bb0f18
Extend `xct_specific_matcher` rule to check for boolean asserts on (un)equal comparisons (#3858) 2023-04-02 12:30:21 +02:00
Kim de Vos b0cbb440c3
Add new `sorted_enum_cases` rule (#4845) 2023-04-02 11:33:20 +02:00
Danny Mösch 58a07eb452
Update SwiftSyntax (#4852) 2023-03-31 23:12:31 +02:00
Danny Mösch 82491e6f84
Add Swift version 5.8 (#4851) 2023-03-31 22:44:25 +02:00
Danny Mösch 3d15419adb
Fix warnings in Swift 5.8/Xcode 14.3 (#4850) 2023-03-31 22:13:20 +02:00
Martin Redington 6a09af169e
Fix crash when parsing apple/swift (#4828) 2023-03-31 20:59:47 +02:00