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 and Roman Lavrov
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
Danny Mösch
4859fa8e82
Ensure that headers matched against always end in a newline ( #6234 )
2025-09-04 23:09:35 +02:00
JP Simard
ab7d117030
Migrate FileHeaderRule from SourceKit to SwiftSyntax ( #6112 )
...
## Summary
Convert FileHeaderRule to use SwiftSyntax instead of SourceKit for
improved performance and better handling of file header comments,
shebangs, and doc comments.
## Key Technical Improvements
- **Enhanced shebang support** properly skipping past `#!/usr/bin/env swift` lines
- **Better comment type discrimination** excluding doc comments from header analysis
- **Accurate position calculation** converting between UTF-8 and UTF-16 offsets for regex matching
- **Improved trivia traversal** for comprehensive header comment collection
- **SwiftLint command filtering** to exclude directive comments from header content
## Migration Details
- Replaced `OptInRule` with `@SwiftSyntaxRule(optIn: true)` annotation
- Implemented `ViolationsSyntaxVisitor` pattern for file-level analysis
- Added logic to start header collection after shebang.endPosition if present
- Distinguished between regular comments and doc comments (///, /** */)
- Maintained UTF-16 offset calculations for NSRegularExpression compatibility
- Added `skipDisableCommandTests: true` for SwiftSyntax disable command behavior
- Removed unnecessary SourceKittenFramework import
2025-06-24 09:48:25 -04:00
JP Simard
81474e36d0
Enforce SourceKitFreeRule contract with fatal error ( #6107 )
2025-06-20 07:25:01 -04:00
Danny Mösch
15b285527a
Separate built-in rule tests from framework tests ( #5924 )
...
* Short names for test modules
* Lint plugins and `Package.swift` in integration tests
* Simplify and merge file groups in Bazel
* Move common functions to `TestHelpers`
2024-12-30 12:26:46 +01:00