Commit Graph
5594 Commits
Author SHA1 Message Date
chrisjfandGitHub 1ef15f3bb7 Update documentation for multiline_arguments_brackets and multiline_literal_brackets (#4098)
- added two triggering examples that are a common style, to make it immediately obvious that they trigger the rules
- also fixed a spelling mistake throughout the examples for the multiline_literal_brackets rule ("Gryffindor" is now correctly spelt)
2022-08-18 09:53:52 +02:00
Kotaro SutoandGitHub 3aa249b8a1 Fix first_where false negative (#4105) 2022-08-17 00:06:32 +00:00
JP SimardandGitHub c2be5b18b4 Only check sourcekitdFailed for SourceKit-based rules (#4104)
And only warn once if it's disabled.

This check is expensive and as more rules move away from SourceKit to
SwiftSyntax, it's increasingly common for rules to not use SourceKit at
all.

In addition, SourceKit crashes used to be a lot more common but I
haven't seen one myself in quite a while.
2022-08-16 16:46:55 +00:00
JP SimardandGitHub f6fc4727b6 Skip OSSCheck if binary hasn't changed (#4103) 2022-08-16 16:07:36 +00:00
JP SimardandGitHub 73c88c3af0 Add version --verbose command (#4102)
Prints out something like this on macOS:

```
Version: 0.49.0-rc.1
Build ID: B43931F3-D096-3704-B41C-FC40673A3F96
```

This can be used to determine if two `swiftlint` executables are
identical.
2022-08-16 14:12:44 +00:00
JP SimardandGitHub ac23f2e89a Log time spent in each custom rule (#4100) 2022-08-15 22:03:06 -04:00
JP SimardandGitHub 781034bd78 Revert "Clear bazel caches" (#4099)
This reverts commit fe43d6ecd4.
2022-08-15 21:39:38 -04:00
JP SimardandGitHub 13703c4466 Update SourceKitFreeRules (#4097)
None of these rules use SourceKit
2022-08-16 00:56:03 +00:00
JP SimardandGitHub 0a3ebdbd37 [Bazel] Define minimum OS versions (#4096)
This helps when building with Xcode 14.
2022-08-15 16:34:50 -04:00
JP SimardandGitHub 408ba29951 Integrate with rules_xcodeproj (#4095) 2022-08-15 16:22:47 -04:00
JP SimardandGitHub 3037946bbc Migrate ClosureSpacingRule to SwiftSyntax (#4092)
Fixes #4090. Continued from #4091.
2022-08-15 18:27:43 +00:00
sarastro-nlandGitHub d1a1485af6 enable glob for includePaths (#4093) 2022-08-15 13:54:49 +00:00
Danny MöschandGitHub ef515ac45e Fix false positive in yoda_condition rule basing it on SwiftSyntax (#4089) 2022-08-14 16:30:09 -04:00
JP Simard 15970311e1 Update CHANGELOG header to say "Master" again 2022-08-12 11:08:49 -04:00
JP Simard 35df4ba6a1 Update bazel ref in readme 2022-08-12 11:07:05 -04:00
JP Simard 6f03036591 release 0.49.0-rc.1 0.49.0-rc.1 2022-08-12 09:49:13 -04:00
JP SimardandGitHub dec9ecbf0b Add note in changelog about upcoming default branch rename (#4088) 2022-08-12 09:46:11 -04:00
JP SimardandGitHub 5e1eaea148 Improve Buildkite grouping (#4086)
Reference: https://buildkite.com/docs/pipelines/managing-log-output
2022-08-12 00:02:13 -04:00
JP SimardandGitHub 21ba7c8280 Update SourceKitten to 0.33.0 (#4085)
https://github.com/jpsim/SourceKitten/releases/tag/0.33.0
2022-08-11 21:04:32 +00:00
JP Simard a163638214 Clean up .swiftlint.yml
By removing references to deleted files
2022-08-11 14:48:43 -04:00
Danny MöschandGitHub 9eb6dd016c Let Sourcery always run independent of changed files (#4084) 2022-08-11 16:28:17 +00:00
Timofey SoloninandGitHub 557c5b5948 Make duplicate_imports rule correctable (#4014)
Also fix reporting of redundant violations when more than one duplicate is present.
2022-08-11 18:19:26 +02:00
Danny MöschandGitHub c1b74cd752 Rename test classes (#4083) 2022-08-11 07:33:11 +02:00
Danny MöschandGitHub a02d4a76cb Remove references to ManuallyTestedExamplesRule protocol (#4082)
Follow-up of d730e0b3fa.
2022-08-10 21:42:10 +00:00
JP Simard dd4aefd23a Danger: Clarify that changelog entries are for user-facing changes only 2022-08-10 17:30:47 -04:00
JP Simard 73f4c3e991 Clarify that changelog entries are for user-facing changes only 2022-08-10 17:29:45 -04:00
Danny MöschandGitHub d730e0b3fa Let all example verification tests be generated by Sourcery (#4076) 2022-08-10 22:49:28 +02:00
Danny MöschandGitHub 828f36958f Introduce option to ignore indentation of compiler directives in indentation_width rule (#4066) 2022-08-10 21:52:32 +02:00
JP Simard adec1c76ee Show Bazel test errors on CI 2022-08-10 15:03:44 -04:00
JP SimardandGitHub 8f620ccd0b Bump SourceKitten bazel ref (#4080)
To avoid a compiler warning when building with Xcode 14 beta 5
2022-08-10 14:30:41 -04:00
JP Simard 481da28f1e Remove internal changelog entries 2022-08-10 13:36:58 -04:00
Sara TavaresandGitHub f8e1b178d6 chore(typo): fix typo on test (#4078) 2022-08-10 13:36:03 -04:00
Sara TavaresandGitHub 436a6f3484 chore(typo): fix typo on func (#4077) 2022-08-10 13:35:42 -04:00
Danny MöschandGitHub 449190d324 Verify examples in rules by default and enforce explicit exclusion (#4065)
A rule must conform to ManuallyTestedExamplesRule to skip generation of a test for its examples.
2022-08-09 22:32:09 +02:00
JP SimardandGitHub 1ac0419eb6 Fix failing Swift 5.7 test (#4075)
Seems like `CGPoint` moved from the `CoreGraphics` module to the
`CoreFoundation` module.
2022-08-09 16:44:05 +00:00
JP SimardandGitHub a97718f4c6 Replace incrementer dispatch queue with an actor (#4073)
To support this, we first must use an async entrypoint to the CLI, which
we do by changing the lint and analyze commands to conform to
`AsyncParsableCommand`.

The in order to map over the closures with suspension points, we pull in
CollectionConcurrencyKit as a new dependency.

This change does not touch SwiftLintFramework, only the CLI target.
2022-08-09 13:06:08 +00:00
JP SimardandGitHub ec8ba17388 Use @main attribute (#4072)
This will allow us to have an async entrypoint and use structured
concurrency features in the future.
2022-08-09 03:48:12 +00:00
JP SimardandGitHub 2b00164081 Remove uses of Result in CLI target (#4071)
Which will make it easier to adopt some structured concurrency features
in the future.
2022-08-08 23:04:20 -04:00
JP SimardandGitHub f39323160c Remove availability check (#4070)
Since SwiftLint now requires macOS 12 or higher to run.
2022-08-09 02:28:32 +00:00
JP SimardandGitHub 235264bb7e Stop building Docker images for Swift 5.5 (#4068)
Follow-up to https://github.com/realm/SwiftLint/pull/4037
2022-08-07 22:03:45 -04:00
JP Simard cc7c400e81 Run bazel tests in sandbox on CI
By setting `IN_PROCESS_SOURCEKIT=1` as `--test_env`
2022-08-07 22:00:10 -04:00
JP SimardandGitHub 8b8b3d0738 Run all tests with Bazel (#4067)
Other than the one test case that uses paths with spaces in them which
Bazel doesn't support.
2022-08-07 16:56:45 -04:00
JP SimardandGitHub 0ded5859a1 Rewrite ColonRule with SwiftSyntax (#4063)
Making it about 7x faster, finding some previously missed cases.
2022-08-04 17:23:52 -04:00
Danny MöschandGitHub cdb87e3869 Verify all examples provided in rule descriptions (#4061) 2022-08-04 23:06:37 +02:00
JP SimardandGitHub c50b42c183 Rewrite CommaRule with SwiftSyntax (#4062)
Making it about 10x faster, finding some previously missed cases and
fixing some previously wrong corrections.

This pulls in the `Collection.windows(ofCount:)` function from Swift
Algorithms.
2022-08-04 04:29:38 +00:00
JP Simard ee655a920c Fix changelog entry placement 2022-08-03 23:14:37 -04:00
Or EliyahuandGitHub 19eda14df1 Fix false positives in duplicated_key_in_dictionary_literal rule (#4057) 2022-07-31 21:07:15 +02:00
Danny MöschandGitHub 54a8435479 Use specific failure messages in extended tests (#4058) 2022-07-31 14:45:47 +02:00
JP SimardandGitHub 1dab8181b8 Fix bazel extra rules tests on Linux (#4056) 2022-07-29 19:34:54 +00:00
JP SimardandGitHub 8b90623b38 [Bazel] Set up tests (#4055)
Run with `bazel test --spawn_strategy=standalone //Tests/...`

Consumers who define rules via `swiftlint_extra_rules` can run tests for
their custom rules too:

```
./bazelw test \
  --spawn_strategy=standalone \
  @SwiftLint//Tests:ExtraRulesTests
```
2022-07-28 19:14:03 +00:00