Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 2 additions & 20 deletions .github/workflows/SyntaxKit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -308,29 +308,11 @@ jobs:
if: ${{ !cancelled() && !failure() && (github.event_name == 'pull_request' || !contains(github.event.head_commit.message, 'ci skip')) }}
runs-on: ubuntu-latest
needs: [build-ubuntu, build-macos, build-windows, build-macos-full, build-android]
env:
MINT_PATH: .mint/lib
MINT_LINK_PATH: .mint/bin
steps:
- uses: actions/checkout@v6
- name: Cache mint
id: cache-mint
uses: actions/cache@v5
env:
cache-name: cache
- uses: jdx/mise-action@v4
with:
path: |
.mint
Mint
key: ${{ runner.os }}-mint-${{ hashFiles('**/Mintfile') }}
restore-keys: |
${{ runner.os }}-mint-
- name: Install mint
if: steps.cache-mint.outputs.cache-hit == ''
run: |
git clone https://github.com/yonaskolb/Mint.git
cd Mint
swift run mint install yonaskolb/mint
cache: true
- name: Lint
run: ./Scripts/lint.sh

Expand Down
6 changes: 6 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[tools]
swiftlint = "0.63.2"
periphery = "3.7.2"
# Community asdf plugin — builds swift-format from source (no official binary releases)
# Plugin repo: https://github.com/eelcokoelewijn/asdf-swift-format
"asdf:eelcokoelewijn/asdf-swift-format" = "602.0.0"
6 changes: 3 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ Sources/SyntaxKit/
- **SwiftDocC Plugin** (1.4.0+) - Documentation generation

### Quality Tools
- **SwiftFormat** (600.0.0) - Code formatting
- **SwiftLint** (0.58.2) - Static analysis (90+ opt-in rules)
- **Periphery** (3.0.1) - Unused code detection
- **SwiftFormat** (602.0.0) - Code formatting
- **SwiftLint** (0.63.2) - Static analysis (90+ opt-in rules)
- **Periphery** (3.7.2) - Unused code detection

## Project Structure

Expand Down
3 changes: 0 additions & 3 deletions Mintfile

This file was deleted.

46 changes: 16 additions & 30 deletions Scripts/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,57 +27,43 @@ else
PACKAGE_DIR="${SRCROOT}"
fi

# Detect OS and set paths accordingly
if [ "$(uname)" = "Darwin" ]; then
DEFAULT_MINT_PATH="/opt/homebrew/bin/mint"
elif [ "$(uname)" = "Linux" ] && [ -n "$GITHUB_ACTIONS" ]; then
DEFAULT_MINT_PATH="$GITHUB_WORKSPACE/Mint/.mint/bin/mint"
elif [ "$(uname)" = "Linux" ]; then
DEFAULT_MINT_PATH="/usr/local/bin/mint"
else
echo "Unsupported operating system"
exit 1
fi

# Use environment MINT_CMD if set, otherwise use default path
MINT_CMD=${MINT_CMD:-$DEFAULT_MINT_PATH}

export MINT_PATH="$PACKAGE_DIR/.mint"
MINT_ARGS="-n -m $PACKAGE_DIR/Mintfile --silent"
MINT_RUN="$MINT_CMD run $MINT_ARGS"

if [ "$LINT_MODE" = "NONE" ]; then
exit
elif [ "$LINT_MODE" = "STRICT" ]; then
SWIFTFORMAT_OPTIONS="--strict --configuration .swift-format"
SWIFTLINT_OPTIONS="--strict"
STRINGSLINT_OPTIONS="--config .strict.stringslint.yml"
else
else
SWIFTFORMAT_OPTIONS="--configuration .swift-format"
SWIFTLINT_OPTIONS=""
STRINGSLINT_OPTIONS="--config .stringslint.yml"
fi

pushd $PACKAGE_DIR
run_command $MINT_CMD bootstrap -m Mintfile
pushd "$PACKAGE_DIR"
if [ -z "$CI" ]; then
mise install
fi
if command -v mise &> /dev/null; then
eval "$(mise env)"
fi

if [ -z "$CI" ]; then
run_command $MINT_RUN swift-format format $SWIFTFORMAT_OPTIONS --recursive --parallel --in-place Sources Tests
run_command $MINT_RUN swiftlint --fix
run_command swift-format format $SWIFTFORMAT_OPTIONS --recursive --parallel --in-place Sources Tests
run_command swiftlint --fix
fi

if [ -z "$FORMAT_ONLY" ]; then
run_command $MINT_RUN swift-format lint --configuration .swift-format --recursive --parallel $SWIFTFORMAT_OPTIONS Sources Tests
run_command $MINT_RUN swiftlint lint $SWIFTLINT_OPTIONS
run_command swift-format lint --configuration .swift-format --recursive --parallel $SWIFTFORMAT_OPTIONS Sources Tests
run_command swiftlint lint $SWIFTLINT_OPTIONS
fi

$PACKAGE_DIR/Scripts/header.sh -d $PACKAGE_DIR/Sources -c "Leo Dion" -o "BrightDigit" -p "SyntaxKit"
$PACKAGE_DIR/Scripts/header.sh -d $PACKAGE_DIR/Sources -c "Leo Dion" -o "BrightDigit" -p "SyntaxKit" -y 2025

run_command $MINT_RUN swiftlint lint $SWIFTLINT_OPTIONS
run_command $MINT_RUN swift-format lint --recursive --parallel $SWIFTFORMAT_OPTIONS Sources Tests
run_command swiftlint lint $SWIFTLINT_OPTIONS
run_command swift-format lint --recursive --parallel $SWIFTFORMAT_OPTIONS Sources Tests

if [ -z "$CI" ]; then
run_command $MINT_RUN periphery scan $PERIPHERY_OPTIONS --disable-update-check
run_command periphery scan $PERIPHERY_OPTIONS --disable-update-check
fi


Expand Down
3 changes: 2 additions & 1 deletion Sources/DocumentationHarness/CodeBlockExtractor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@
/// - Parameter content: The markdown content to parse
/// - Returns: Array of extracted code blocks
/// - Throws: CodeBlockExtractorError if extraction fails
package typealias CodeBlockExtractor = @Sendable (String) throws(CodeBlockExtractorError) ->
package typealias CodeBlockExtractor =
@Sendable (String) throws(CodeBlockExtractorError) ->
[CodeBlock]
4 changes: 2 additions & 2 deletions Tests/SyntaxDocTests/Settings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ internal enum Settings {
}
} else {
#if os(Android) // os(Android) is a valid Swift platform condition since Swift 5.9
let resolvedPath = filePath
let resolvedPath = filePath
#else
let resolvedPath = "Sources/SyntaxKit/" + filePath
let resolvedPath = "Sources/SyntaxKit/" + filePath
#endif
return Self.projectRoot.appendingPathComponent(resolvedPath)
}
Expand Down
Loading