17 Commits

Author SHA1 Message Date
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
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
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
Copilot 038135e14d Enable prefer_key_path rule (#6331)
Co-authored-by: SimplyDanny <16365760+SimplyDanny@users.noreply.github.com>
2025-10-31 16:58:41 +00:00
Danny Mösch 4065fc8437 Enable upcoming feature MemberImportVisibility (#6286) 2025-10-08 08:12:05 +02:00
Danny Mösch bae9a2a351 Remove deprecated connectivity check (#6278) 2025-10-04 11:35:34 +02:00
Martin Redington 13c0c235eb only rule should work for individual custom rules (#6057) 2025-09-18 10:21:47 +01:00
Danny Mösch c1ffdfe891 Enable prefer_condition_list rule (#6163) 2025-07-12 09:41:00 -04:00
Danny Mösch 599e51a5a2 Format code (#6151) 2025-07-02 17:50:53 -04:00
Martin Redington f72f195ece Fix error reporting (#6061) 2025-05-21 11:34:46 +01:00
Keith Bauer 4eb19bef17 Parallelize file grouping (#5983) 2025-02-01 07:10:44 -05:00
Keith Bauer 010028acfa Parallelize SwiftLintFile construction for a modest speedup (#5967) 2025-01-29 16:33:32 +01:00
Danny Mösch fcdc98a52d Revert "Improve performance of excluded files filter" (#5962)
This reverts commit 152355e36f from #5157.

# Conflicts:
#	tools/oss-check
2025-01-15 19:15:44 +01:00
Danny Mösch 152355e36f Improve performance of excluded files filter (#5157)
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.
2024-12-25 17:33:33 -05:00
Danny Mösch a6c4fd98bc Move files from SwiftLintCore to SwiftLintFramework
Ideally, SwiftLintCore would some day only contain components
that are needed to define rules. Consequently, it would be the
only bundle required to import for (external) rule development.
2024-12-23 12:51:43 +01:00