Skip to content

Commit e927cc0

Browse files
authored
Migrate from Mint to mise for tool management (#139)
1 parent 781e78f commit e927cc0

7 files changed

Lines changed: 31 additions & 59 deletions

File tree

.github/workflows/SyntaxKit.yml

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -308,29 +308,11 @@ jobs:
308308
if: ${{ !cancelled() && !failure() && (github.event_name == 'pull_request' || !contains(github.event.head_commit.message, 'ci skip')) }}
309309
runs-on: ubuntu-latest
310310
needs: [build-ubuntu, build-macos, build-windows, build-macos-full, build-android]
311-
env:
312-
MINT_PATH: .mint/lib
313-
MINT_LINK_PATH: .mint/bin
314311
steps:
315312
- uses: actions/checkout@v6
316-
- name: Cache mint
317-
id: cache-mint
318-
uses: actions/cache@v5
319-
env:
320-
cache-name: cache
313+
- uses: jdx/mise-action@v4
321314
with:
322-
path: |
323-
.mint
324-
Mint
325-
key: ${{ runner.os }}-mint-${{ hashFiles('**/Mintfile') }}
326-
restore-keys: |
327-
${{ runner.os }}-mint-
328-
- name: Install mint
329-
if: steps.cache-mint.outputs.cache-hit == ''
330-
run: |
331-
git clone https://github.com/yonaskolb/Mint.git
332-
cd Mint
333-
swift run mint install yonaskolb/mint
315+
cache: true
334316
- name: Lint
335317
run: ./Scripts/lint.sh
336318

.mise.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[tools]
2+
swiftlint = "0.63.2"
3+
periphery = {version = "3.7.2", os = ["macos"]}
4+
# Community asdf plugin — builds swift-format from source (no official binary releases)
5+
# Plugin repo: https://github.com/eelcokoelewijn/asdf-swift-format
6+
"asdf:eelcokoelewijn/asdf-swift-format" = "602.0.0"

CLAUDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ Sources/SyntaxKit/
8282
- **SwiftDocC Plugin** (1.4.0+) - Documentation generation
8383

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

8989
## Project Structure
9090

Mintfile

Lines changed: 0 additions & 3 deletions
This file was deleted.

Scripts/lint.sh

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -27,57 +27,43 @@ else
2727
PACKAGE_DIR="${SRCROOT}"
2828
fi
2929

30-
# Detect OS and set paths accordingly
31-
if [ "$(uname)" = "Darwin" ]; then
32-
DEFAULT_MINT_PATH="/opt/homebrew/bin/mint"
33-
elif [ "$(uname)" = "Linux" ] && [ -n "$GITHUB_ACTIONS" ]; then
34-
DEFAULT_MINT_PATH="$GITHUB_WORKSPACE/Mint/.mint/bin/mint"
35-
elif [ "$(uname)" = "Linux" ]; then
36-
DEFAULT_MINT_PATH="/usr/local/bin/mint"
37-
else
38-
echo "Unsupported operating system"
39-
exit 1
40-
fi
41-
42-
# Use environment MINT_CMD if set, otherwise use default path
43-
MINT_CMD=${MINT_CMD:-$DEFAULT_MINT_PATH}
44-
45-
export MINT_PATH="$PACKAGE_DIR/.mint"
46-
MINT_ARGS="-n -m $PACKAGE_DIR/Mintfile --silent"
47-
MINT_RUN="$MINT_CMD run $MINT_ARGS"
48-
4930
if [ "$LINT_MODE" = "NONE" ]; then
5031
exit
5132
elif [ "$LINT_MODE" = "STRICT" ]; then
5233
SWIFTFORMAT_OPTIONS="--strict --configuration .swift-format"
5334
SWIFTLINT_OPTIONS="--strict"
5435
STRINGSLINT_OPTIONS="--config .strict.stringslint.yml"
55-
else
36+
else
5637
SWIFTFORMAT_OPTIONS="--configuration .swift-format"
5738
SWIFTLINT_OPTIONS=""
5839
STRINGSLINT_OPTIONS="--config .stringslint.yml"
5940
fi
6041

61-
pushd $PACKAGE_DIR
62-
run_command $MINT_CMD bootstrap -m Mintfile
42+
pushd "$PACKAGE_DIR"
43+
if [ -z "$CI" ]; then
44+
mise install
45+
fi
46+
if command -v mise &> /dev/null; then
47+
eval "$(mise env)"
48+
fi
6349

6450
if [ -z "$CI" ]; then
65-
run_command $MINT_RUN swift-format format $SWIFTFORMAT_OPTIONS --recursive --parallel --in-place Sources Tests
66-
run_command $MINT_RUN swiftlint --fix
51+
run_command swift-format format $SWIFTFORMAT_OPTIONS --recursive --parallel --in-place Sources Tests
52+
run_command swiftlint --fix
6753
fi
6854

6955
if [ -z "$FORMAT_ONLY" ]; then
70-
run_command $MINT_RUN swift-format lint --configuration .swift-format --recursive --parallel $SWIFTFORMAT_OPTIONS Sources Tests
71-
run_command $MINT_RUN swiftlint lint $SWIFTLINT_OPTIONS
56+
run_command swift-format lint --configuration .swift-format --recursive --parallel $SWIFTFORMAT_OPTIONS Sources Tests
57+
run_command swiftlint lint $SWIFTLINT_OPTIONS
7258
fi
7359

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

76-
run_command $MINT_RUN swiftlint lint $SWIFTLINT_OPTIONS
77-
run_command $MINT_RUN swift-format lint --recursive --parallel $SWIFTFORMAT_OPTIONS Sources Tests
62+
run_command swiftlint lint $SWIFTLINT_OPTIONS
63+
run_command swift-format lint --recursive --parallel $SWIFTFORMAT_OPTIONS Sources Tests
7864

7965
if [ -z "$CI" ]; then
80-
run_command $MINT_RUN periphery scan $PERIPHERY_OPTIONS --disable-update-check
66+
run_command periphery scan $PERIPHERY_OPTIONS --disable-update-check
8167
fi
8268

8369

Sources/DocumentationHarness/CodeBlockExtractor.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,6 @@
3131
/// - Parameter content: The markdown content to parse
3232
/// - Returns: Array of extracted code blocks
3333
/// - Throws: CodeBlockExtractorError if extraction fails
34-
package typealias CodeBlockExtractor = @Sendable (String) throws(CodeBlockExtractorError) ->
34+
package typealias CodeBlockExtractor =
35+
@Sendable (String) throws(CodeBlockExtractorError) ->
3536
[CodeBlock]

Tests/SyntaxDocTests/Settings.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ internal enum Settings {
8585
}
8686
} else {
8787
#if os(Android) // os(Android) is a valid Swift platform condition since Swift 5.9
88-
let resolvedPath = filePath
88+
let resolvedPath = filePath
8989
#else
90-
let resolvedPath = "Sources/SyntaxKit/" + filePath
90+
let resolvedPath = "Sources/SyntaxKit/" + filePath
9191
#endif
9292
return Self.projectRoot.appendingPathComponent(resolvedPath)
9393
}

0 commit comments

Comments
 (0)