Commit Graph

12 Commits

Author SHA1 Message Date
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 aa67f5ac13 Adopt typed throws where possible (#5922) 2025-09-27 19:11:46 +02: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
Danny Mösch 6d5af5f924 Enable async_without_await rule (#6104) 2025-06-19 15:01:42 -04:00
Keith Bauer 4eb19bef17 Parallelize file grouping (#5983) 2025-02-01 07:10:44 -05: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
BlueVirusX e87efff39b Support Xcode input file lists (#5790)
Adds the option `--use-script-input-file-lists` and parsing for `.xcfilelist` files.
2024-10-25 06:57:41 -04:00
Danny Mösch 1ec3fdc58d Pass options to visitor (#5811) 2024-09-29 14:23:17 -04:00
Danny Mösch 246643fe55 Keep only command-line related functions in swiftlint module (#5806)
Swift 6 doesn't allow importing executable targets. So we need to
move testable logic into a framework.
2024-09-29 17:23:46 +02:00