Commit Graph

4201 Commits

Author SHA1 Message Date
Danny Mösch d2327ec0c9 Prepare 0.64.0-rc.1 release 2026-01-24 21:15:31 +00:00
Danny Mösch ca72b68404 Do not just skip hidden files (#6460) 2026-01-24 22:13:56 +01:00
Danny Mösch 5d44592e27 Run ConfigPathResolutionTests with Bazel 2026-01-24 22:13:56 +01:00
Danny Mösch efaf900d50 Use URL enumerator 2026-01-24 22:13:56 +01:00
Danny Mösch 40f03cd918 Use relative display path in output for duplicated files 2026-01-24 22:13:56 +01:00
Danny Mösch 450d51c8d2 Rename property 2026-01-24 22:13:56 +01:00
Danny Mösch f96d7d9e73 Assume absolute path patterns 2026-01-24 22:13:56 +01:00
Danny Mösch 4b12699ebe Extend basic globbing on Windows 2026-01-24 22:13:56 +01:00
Danny Mösch 6c1ae86eb3 Use URL for file paths throughout the code base
# Conflicts:
#	Source/SwiftLintFramework/Extensions/FileManager+SwiftLint.swift
#	Tests/IntegrationTests/ConfigPathResolutionTests.swift
2026-01-24 22:13:56 +01:00
Saleem Abdulrasool 3c7c1e6ae1 Fix Windows path handling in various places
An assortment of fixes that improve the test coverage on Windows. With
this set, local testing reveals 1 failure (RemoteCycleDetection) and
another set of test failures due to Windows globbing not matching the
POSIX semantics.

Co-authored-by: Roman Lavrov <roman.lavrov@thebrowser.company>
2026-01-24 22:13:56 +01:00
Declan McKenna d3220ed108 Add ignore_regex option to large_tuple rule (#6452) 2026-01-24 14:52:12 +00:00
Danny Mösch 987f3603ae Use start position of closure to check if rule is disabled (#6458) 2026-01-23 20:52:05 +01:00
Danny Mösch 335edded41 Inline dedicated rule test (#6459) 2026-01-23 14:25:19 -05:00
Danny Mösch 6de2cc9587 Use SwiftSyntax 6.4 pre-release 2026-01-20 (#6447) 2026-01-21 00:00:37 +01:00
Danny Mösch 71396cc146 Prepare 0.63.1 release 2026-01-15 19:47:12 +00:00
Danny Mösch 8978ae2ccb Add --disable-sourcekit flag to disable SourceKit (#6439) 2026-01-15 20:30:52 +01:00
Danny Mösch faa5859155 Introduce guarded filepath provider for file collection (#6435) 2026-01-14 18:06:13 -05:00
Danny Mösch 9a634bc8a0 Retain async initializers in actors in async_without_await (#6436) 2026-01-14 17:01:50 -05:00
Danny Mösch 35e3d0c6f4 Mark directories as such to enforce a new hierarchy (#6434) 2026-01-13 21:25:22 +01:00
Danny Mösch 21ed830b62 Import implicitly referenced framework (#6430) 2026-01-11 17:53:06 +00:00
Danny Mösch e6b9643965 Support Swift version 6.3 (#6428) 2026-01-11 18:52:10 +01:00
tristan-burnside-anz d4585d4814 Exclude bool literals in optional_enum_case_name correction (#6418) 2026-01-08 09:39:47 +00:00
Copilot 7a9186a39b Ignore override declarations in async_without_await rule (#6417)
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2026-01-07 20:26:30 +01:00
Danny Mösch cb578f4629 Use stack to track nested closures (#6411) 2026-01-05 10:50:41 +01:00
Danny Mösch 8d3ed07cc5 Prepare 0.63.0 release 2026-01-03 12:23:31 +00:00
Danny Mösch 44f2ed46a9 Add only_in_closures option to redundant_self to maintain old behavior (#6406) 2026-01-03 07:16:11 -05:00
Danny Mösch 21ff90f564 Keep escaping autoclosure passed on (#6394) 2025-12-27 09:49:34 -05:00
Danny Mösch 779c5ab94c Keep unwrapped self in extensions for optional types (#6396) 2025-12-27 09:39:39 -05:00
Danny Mösch c09e3bbe34 Taint branches of tainted ternary expressions (#6393) 2025-12-26 22:49:21 +01:00
Danny Mösch 154e47e481 Keep closures assigned to wildcard variables as non-escaping (#6392) 2025-12-25 23:03:47 +01:00
Danny Mösch f72d03c84a Prepare 0.63.0-rc.2 release 2025-12-20 11:28:50 +00:00
Brett Best fb046797b2 Add handling for access level modifiers on imports (#6377) 2025-12-19 04:10:07 -05:00
Danny Mösch 2e78f40e54 Use directory enumerator to collect and exclude files at the same time (#6366) 2025-12-17 19:47:21 +01:00
Brett Best 5b1b83812a Support Swift version 6.2.3 (#6375) 2025-12-13 09:15:47 +00:00
Danny Mösch 66d4818cd3 Support Swift version 6.2.2 (#6373) 2025-12-10 21:10:39 +00:00
Danny Mösch ac701c088c Improve performance of excluded files filter (#6342)
The current algorithm is like "collect all included files and subtract all excluded files".
Collecting all included and all excluded files relies on the file system. This can become slow
when the patterns used to exclude files resolve to a large number of files.

The new approach only collects all lintable files and checks them against the exclude patterns.
This can be done by in-memory string-regex-match and does therefore not require file system accesses.
The new implementation also no longer traverses directories that already match an exclude pattern.

(cherry picked from commit 152355e36f)
2025-12-07 15:58:23 +01:00
Danny Mösch 32c33c2588 Re-enable redundant_self rule (#6368) 2025-12-07 08:11:08 -05:00
Danny Mösch d1cdf8ce20 Extend redundant_self_in_closure to find all redundant selfs (#6346) 2025-12-07 07:49:50 -05:00
Saleem Abdulrasool 562ec8f369 Correct incorrect handling of file paths (#6355)
`URL.path` is not a usable rendering of the path. `URL.path` represents
the URI path. If the path is meant to be consumable as a file path, the
file system representation (aka FSR) must be retrieved.

This improves the file path handling and makes additional tests now
pass.

Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2025-12-01 22:02:12 +01:00
Danny Mösch 2e87be0398 Infer name of parent rule in configurations (#6363) 2025-12-01 14:15:00 -05:00
Rodion Ivashkov 31cdc24101 Add new multiline_call_arguments rule (#6223)
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
2025-11-30 18:16:11 -05:00
Saleem Abdulrasool e526fdef94 Repair GenerationTests on Windows (#6354) 2025-11-28 09:04:17 +01:00
Roman Lavrov 2e92f75a69 Replace invalid characters with underscore in caching (#6358) 2025-11-27 15:12:18 -05:00
Saleem Abdulrasool 339d250464 Port to Windows (#5030)
At least ensure it compiles just fine on Windows.

* build: add CryptoSwift dependency for Windows
* SwiftLintBuiltInRules: treat Windows similar to Linux wrt `NSDataDetector`
* SwiftLintCore: initial pass for Windows support

Add some Windows specific handling for the paths in SwiftLintCore.  The
one piece that this change does not cover is the handling of `glob` as
that is not an ISO C standard function and as such there is no `glob` on
Windows.  This will be worked through separately.

* swiftlint: add a Windows port

This enables building the swiftlint command on Windows.  There is no
system ioctl for terminal access, instead, we can use the Win32 Console
API surface to query the console size.  In the case of a failure, assume
the width to be 80-columns (as the standard VGA console is 80x25).

* WIP/SwiftLintCore: port the `glob` function to Windows

Windows does not support `glob` as a standard C library function as that
is not part of the C standard.  Attempt to emulate that through the use
of `FindFirstFileW` and `FindNextFile` to iterate the matching files
given a pattern.  This should allow us to start enumerating the files as
if we had `glob` available.
2025-11-21 09:59:28 +01:00
Danny Mösch f1562a629e Exclude only function signatures (#6348) 2025-11-18 17:27:53 +01:00
Jared Grubb e57a2d4860 Do not trigger override_in_extension inside @implementation (#6339) 2025-11-15 12:26:10 +00:00
Danny Mösch d74b8726bc Improve @escaping tracking recognizing local variable assignments (#6341) 2025-11-15 11:42:57 +01:00
Danny Mösch 97579b5dcf Add new unneeded_escaping rule (#6337) 2025-11-14 18:54:51 +01:00
Danny Mösch f59f41b36e Support Swift version 6.2.1 (#6338) 2025-11-09 13:37:43 +01:00
Danny Mösch 9e5a526483 Enable unneeded_throws_rethrows rule (#6335) 2025-11-03 20:24:57 +01:00