Commit Graph

5952 Commits

Author SHA1 Message Date
Marcelo Fabri ecc30764d8 Remove unused declaration 2022-11-06 19:15:15 -08:00
Marcelo Fabri 4ec35845ad Rewrite `nimble_operator` rule with SwiftSyntax 2022-11-06 19:13:20 -08:00
Marcelo Fabri 6c7e2107ae
Rewrite `nslocalizedstring_key` with SwiftSyntax (#4523) 2022-11-06 19:12:53 -08:00
Danny Mösch 1edef5ebdc
Trigger `prefer_self_in_static_references` rule on constructor calls (#4519) 2022-11-06 14:55:28 +01:00
Danny Mösch 7e8a3ae2ac
Introduce `onlyElement` property on `Collection` (#4518) 2022-11-06 07:37:44 -05:00
Marcelo Fabri 45ac3dcdff
Rewrite `required_enum_case` with SwiftSyntax (#4521) 2022-11-06 01:26:11 -08:00
Marcelo Fabri 1c675bc993
Rewrite `balanced_xctest_lifecycle` with SwiftSyntax (#4520) 2022-11-06 00:05:32 -07:00
Marcelo Fabri fc0c0c7f5b
Rewrite `pattern_matching_keywords` with SwiftSyntax (#4490) 2022-11-05 23:16:59 -07:00
Marcelo Fabri 22522254df
Validate shorthand option binding in `self_binding` rule (#4514)
* Validate shorthand option binding in `self_binding` rule

* Fix CHANGELOG
2022-11-05 21:32:09 -07:00
Danny Mösch 9a706ba371
Trigger `prefer_self_in_static_references` rule in computed property blocks (#4517) 2022-11-06 00:19:48 +01:00
Danny Mösch d4ea19e434
Trigger `prefer_self_in_static_references` rule on key paths (#4516) 2022-11-05 13:39:27 +01:00
Danny Mösch eb3d502ad7
Rephrase rule description letting it no longer refer to classes only (#4515) 2022-11-05 07:13:24 -04:00
Danny Mösch 65874dc40f
Rewrite `prefer_self_in_static_references` with SwiftSyntax (#4504) 2022-11-05 11:46:33 +01:00
JP Simard 759408fdb5
Update SwiftSyntax (#4506)
This update pulls in https://github.com/apple/swift-syntax/pull/1050,
which fixes a memory leak, reducing memory usage by up to 3x and
improves lint times by 20%-50% in my tests.
2022-11-04 06:05:38 -04:00
Craig Siemens ec5124d939
Rewrite `multiline_arguments_brackets` with SwiftSyntax (#4512)
Fix false-positives when a function call has a single line closure.
2022-11-03 21:57:27 -04:00
JP Simard 05e06d1945
Allow passing a commit to `update-swift-syntax.sh` (#4509)
E.g.

```console
$ ./tools/update-swift-syntax.sh e19c5f2909127ce4537d6f8981919aba4645ce4e
```
2022-11-03 16:05:09 -04:00
John Szumski 6fcdd8077f
Adds NSError to the list of types in discouraged_direct_init. (#4508) 2022-11-03 13:52:30 -04:00
Danny Mösch 32152646f3
Use `Self` in constructor calls (#4505) 2022-11-02 22:50:22 +00:00
JP Simard e97119efec
Migrate `orphaned_doc_comment` to use SwiftSyntax classifications (#4461) 2022-11-02 15:55:47 +00:00
JP Simard fce8283843
Fix & clean up Dockerfile (#4502)
We no longer need `_InternalSwiftSyntaxParser`, but we do need
`libswiftCore.so`.

Fixes https://github.com/realm/SwiftLint/issues/4501

Add a more useful validation test at the end of the Dockerfile.
In addition to running `swiftlint version`, also actually run the linter
which will exercise the SourceKit codepaths.
2022-11-02 10:28:55 -04:00
JP Simard f1f6a3c4a0
Add `ByteSourceRange.toSourceKittenByteRange()` helper (#4500)
This will be useful for other rules too.
2022-11-01 14:13:29 -04:00
César Pinto Castillo c56e19a0c2
Fix SwiftLint support on Xcode Cloud (#4485)
Fixes #4484 by checking the process environment for all the expected
environment variables set by Xcode Cloud.
2022-11-01 13:00:50 -04:00
JP Simard 3800ad32bf
Sort list of rules migrated to SwiftSyntax in changelog (#4499) 2022-10-31 13:07:53 -04:00
JP Simard 79e3c8bd4a
Add special handling for https://github.com/apple/swift/issues/61817 (#4498) 2022-10-31 09:58:36 -04:00
github-actions[bot] 6ad4a704f5
Update SwiftSyntax (#4497) 2022-10-31 09:49:40 -04:00
Marcelo Fabri 20bfe264f5
Rewrite `overridden_super_call` and `prohibited_super_call` with SwiftSyntax (#4493)
* Rewrite `overridden_super_call` with SwiftSyntax

* Rewrite `prohibited_super_call` too
2022-10-30 20:28:25 -07:00
Marcelo Fabri 697eaa73dd
Rewrite `private_subject` rule with SwiftSyntax (#4495) 2022-10-30 18:41:57 -07:00
Marcelo Fabri 5144cccb57
Revert "[OSSCheck] Cache repos (#4456) (#4477)" (#4494)
This reverts commit 6b5352feac.
2022-10-30 17:46:53 -07:00
Marcelo Fabri 98e9c2f1f4
Fix SwiftVersionTests when using Xcode 14.2 (#4492) 2022-10-30 19:50:49 -04:00
Henry 63c043664d
Add new `no_magic_numbers` rule (#4265) 2022-10-30 15:28:20 +01:00
JP Simard a18436d4d6
Rewrite `optional_enum_case_matching` with SwiftSyntax (#4488) 2022-10-28 19:30:33 +00:00
JP Simard a5c44605af
Update to rules_xcodeproj 0.10.0 (#4486)
Mostly has optimizations: https://github.com/buildbuddy-io/rules_xcodeproj/releases/tag/0.10.0
2022-10-28 14:17:03 -04:00
JP Simard b7f621c239
Make `update-swift-syntax.sh` script portable (#4487) 2022-10-28 14:16:48 -04:00
JP Simard d551cb8c16
Update SwiftSyntax (#4480)
Moves syntax classifications to a new IDEUtils module.
2022-10-28 09:23:06 -04:00
JP Simard 1b59a3f168
Cache location converters (#4481)
This is 2%-12% faster according to OSSCheck
2022-10-26 12:37:16 -04:00
JP Simard 6b5352feac
[OSSCheck] Cache repos (#4456) (#4477)
This should speed up OSSCheck runs considerably.

In my local testing, cloning repos goes from 77s to 29s on a 100 Mbps
connection.
2022-10-26 10:58:23 -04:00
JP Simard 9a305dd2e6
Update CI setup instructions (#4479) 2022-10-26 10:25:06 -04:00
github-actions[bot] 7738f0c0a5
Update SwiftSyntax (#4476)
Co-authored-by: jpsim <jpsim@users.noreply.github.com>
2022-10-24 17:10:17 -04:00
JP Simard 374130bb56
Update SwiftSyntax on a weekly scheduled CI job (#4475) 2022-10-24 16:37:29 -04:00
Marcelo Fabri d37465ad37
Rewrite `vertical_parameter_alignment` with SwiftSyntax (#4466)
* Rewrite `vertical_parameter_alignment` rule with SwiftSyntax

* Validate inits
2022-10-24 12:56:48 -07:00
Marcelo Fabri 50c85ef5c1
Rewrite `explicit_top_level_acl` with SwiftSyntax (#4450) 2022-10-24 11:31:12 -07:00
Marcelo Fabri fa6db3cca7
Rewrite `collection_alignment` rule with SwiftSyntax (#4472) 2022-10-24 10:51:31 -07:00
JP Simard 96925d480e
Revert "[OSSCheck] Cache repos (#4456)" (#4473)
This reverts commit f0f46a45eb.

This might need more error handling / recovery:
https://github.com/realm/SwiftLint/pull/4456#issuecomment-1288792588
2022-10-24 06:26:52 -04:00
Marcelo Fabri 31ea58381c
Add example for #3558 (#4471)
Fixes #3558
2022-10-24 06:14:30 -04:00
Marcelo Fabri 95838aa230
Add example for #2008 (#4470)
Fixes #2008
2022-10-24 05:32:56 -04:00
Marcelo Fabri f8d505a225
Add example for #3945 (#4469)
Fixes #3945
2022-10-24 09:23:37 +00:00
Marcelo Fabri 7a8de1c966
Add example for #2782 (#4468)
Fixes #2782
2022-10-24 09:22:31 +00:00
Marcelo Fabri 7a3d0d55a0
Add example for #3022 (#4467)
Fixes #3022
2022-10-24 08:56:23 +00:00
Marcelo Fabri 1c6b6c67e0
Rewrite `duplicated_key_in_dictionary_literal` with SwiftSyntax (#4396) 2022-10-23 23:11:17 -07:00
Marcelo Fabri 87bebb6744
Rewrite `test_case_accessibility` with SwiftSyntax (#4446) 2022-10-23 17:39:45 -07:00