You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(standards): add Swift and Kotlin standards pages and blog posts
Add standards documentation pages for Swift (SwiftLint, swift-format,
swift test) and Kotlin (ktlint, detekt, Gradle). Add announcement blog
posts for both language ecosystems. Update standards index with new
languages in the support matrix.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
description: "DevRail now supports Kotlin with ktlint, detekt, and Gradle -- covering both server-side and Android Kotlin development."
5
+
---
6
+
7
+
DevRail now supports Kotlin as its tenth language ecosystem. Whether you are building server-side Kotlin services or Android applications, DevRail provides consistent linting, static analysis, testing, and security scanning through the same Makefile targets and CI pipelines used by every other supported language.
8
+
9
+
## What's Included
10
+
11
+
The dev-toolchain container ships JDK 21, the Kotlin compiler, Gradle, and dedicated analysis tools:
12
+
13
+
-**ktlint** -- Kotlin linter and formatter that enforces the official Kotlin coding conventions, serving as a dual-purpose tool for both style checking and auto-formatting
14
+
-**detekt** -- configurable static code analysis for Kotlin, covering complexity, potential bugs, and code smells
15
+
-**Gradle** -- the standard Kotlin build tool, used for running tests and dependency analysis
16
+
-**OWASP dependency-check** -- Gradle plugin for scanning dependencies against the National Vulnerability Database
17
+
-**trivy** -- universal dependency scanning for Gradle projects
18
+
19
+
JDK 21 (Eclipse Temurin) is included in the container alongside the Kotlin compiler and Gradle distribution.
20
+
21
+
## Configuration
22
+
23
+
Add `kotlin` to your `.devrail.yml`:
24
+
25
+
```yaml
26
+
languages:
27
+
- kotlin
28
+
```
29
+
30
+
ktlint reads `.editorconfig` at the repository root -- no separate config file needed. detekt reads `detekt.yml` for static analysis rules. Both are scaffolded by `devrail init` when Kotlin is declared.
31
+
32
+
## Makefile Targets
33
+
34
+
The standard targets work out of the box:
35
+
36
+
```bash
37
+
make lint # ktlint + detekt (if detekt.yml exists)
38
+
make format # ktlint --format --dry-run
39
+
make fix # ktlint --format
40
+
make test # gradle test (if build.gradle.kts or build.gradle exists)
41
+
make security # gradle dependencyCheckAnalyze (OWASP)
42
+
make check # all of the above
43
+
```
44
+
45
+
## Android Projects
46
+
47
+
The container handles ktlint, detekt, and Gradle test for all Kotlin projects. Android-specific checks (Android Lint) require the Android SDK, which is not included in the container. For Android projects, configure a separate CI job:
48
+
49
+
```yaml
50
+
# GitHub Actions example -- Android Lint job
51
+
- name: Run Android Lint
52
+
runs-on: ubuntu-latest
53
+
steps:
54
+
- uses: actions/checkout@v4
55
+
- uses: actions/setup-java@v4
56
+
with:
57
+
distribution: temurin
58
+
java-version: 21
59
+
- name: Setup Android SDK
60
+
uses: android-actions/setup-android@v3
61
+
- run: ./gradlew lint
62
+
```
63
+
64
+
Server-side Kotlin projects (Spring Boot, Ktor, etc.) work entirely inside the container with no additional setup.
65
+
66
+
## Pre-Commit Hooks
67
+
68
+
ktlint runs as a local pre-commit hook (under 30 seconds):
description: "DevRail now supports Swift with SwiftLint, swift-format, and swift test -- bringing Apple-platform development into the standards-driven workflow."
5
+
---
6
+
7
+
DevRail now supports Swift as its ninth language ecosystem. Swift projects get the same standards-driven workflow as every other DevRail-supported language: linting, formatting, testing, and security scanning through consistent Makefile targets and CI pipelines.
8
+
9
+
## What's Included
10
+
11
+
The dev-toolchain container ships the full Swift toolchain alongside dedicated linting and formatting tools:
12
+
13
+
-**SwiftLint** -- the de facto standard Swift linter, enforcing style and convention rules with extensive opt-in rule coverage
14
+
-**swift-format** -- Apple's official code formatter, handling all whitespace, indentation, and line-breaking decisions
15
+
-**swift test** -- Swift Package Manager's built-in test runner for SPM-based projects
16
+
-**trivy** -- universal dependency scanning via `Package.resolved`
17
+
18
+
The full Swift toolchain (swiftc, swift build, swift test, Swift Package Manager) is included in the container, COPY'd from the official `swift:6.1-slim-bookworm` image.
19
+
20
+
## Configuration
21
+
22
+
Add `swift` to your `.devrail.yml`:
23
+
24
+
```yaml
25
+
languages:
26
+
- swift
27
+
```
28
+
29
+
SwiftLint reads `.swiftlint.yml` at the repository root. swift-format reads `.swift-format` (JSON). Both config files are scaffolded by `devrail init` when Swift is declared.
30
+
31
+
## Makefile Targets
32
+
33
+
The standard targets work out of the box:
34
+
35
+
```bash
36
+
make lint # swiftlint lint --strict
37
+
make format # swift-format lint --strict -r .
38
+
make fix # swift-format format -i -r .
39
+
make test # swift test (if Package.swift exists)
40
+
make check # all of the above
41
+
```
42
+
43
+
## Xcode Projects
44
+
45
+
The container runs on Linux, so `xcodebuild` is not available inside it. For Xcode-based projects (iOS, macOS apps), the container handles linting and formatting. Testing requires a separate macOS CI runner:
46
+
47
+
```yaml
48
+
# GitHub Actions example -- macOS job for xcodebuild
49
+
- name: Run Xcode tests
50
+
runs-on: macos-latest
51
+
steps:
52
+
- uses: actions/checkout@v4
53
+
- run: xcodebuild test -scheme MyApp -destination 'platform=iOS Simulator,name=iPhone 16'
54
+
```
55
+
56
+
SPM-based projects (those with `Package.swift`) run `swift test` inside the container with no additional setup.
57
+
58
+
## Pre-Commit Hooks
59
+
60
+
SwiftLint runs as a local pre-commit hook (under 30 seconds):
61
+
62
+
```yaml
63
+
repos:
64
+
- repo: https://github.com/realm/SwiftLint
65
+
rev: 0.58.0
66
+
hooks:
67
+
- id: swiftlint
68
+
args: ["lint", "--strict"]
69
+
```
70
+
71
+
## Getting Started
72
+
73
+
Pull the latest container and add Swift to your project:
74
+
75
+
```bash
76
+
docker pull ghcr.io/devrail-dev/dev-toolchain:v1
77
+
```
78
+
79
+
Or use `devrail init` to set up a new Swift project:
Copy file name to clipboardExpand all lines: content/docs/standards/_index.md
+17-15Lines changed: 17 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: "Standards"
3
3
linkTitle: "Standards"
4
4
weight: 20
5
-
description: "Per-language tooling standards for Python, Bash, Terraform, Ansible, Ruby, Go, JavaScript/TypeScript, Rust, and universal security tools."
5
+
description: "Per-language tooling standards for Python, Bash, Terraform, Ansible, Ruby, Go, JavaScript/TypeScript, Rust, Swift, Kotlin, and universal security tools."
6
6
---
7
7
8
8
DevRail defines opinionated tooling standards for each supported language ecosystem. Every tool is pre-installed in the dev-toolchain container and invoked through consistent Makefile targets.
@@ -11,15 +11,15 @@ DevRail defines opinionated tooling standards for each supported language ecosys
11
11
12
12
The following table shows the default tool for each concern per language. These tools are pre-installed in the `dev-toolchain` container.
description: "Kotlin tooling standards: ktlint, detekt, Gradle, and Android Lint."
6
+
---
7
+
8
+
Kotlin projects use ktlint for linting and formatting, detekt for static analysis, Gradle for building and testing, and Android Lint for Android-specific checks on CI.
- **ktlint is dual-purpose: linter and formatter.** It checks and enforces the official Kotlin coding conventions. Run `ktlint` to check and `ktlint --format` to fix.
122
+
- **detekt complements ktlint.** While ktlint focuses on style and formatting, detekt provides deeper static analysis (complexity, potential bugs, code smells). Both run in CI.
123
+
- **Gradle is the standard build tool.** Both `gradle test` and dependency checking require Gradle. The container ships Gradle and JDK 21 so projects do not need the Gradle wrapper, though `gradlew` is supported if present.
124
+
- **Android Lint requires the Android SDK.** For Android projects, configure a separate CI job with the Android SDK. The container handles ktlint, detekt, and Gradle test for all Kotlin projects.
125
+
- **JDK 21 is included in the container.** Eclipse Temurin JDK 21 is COPY'd from a builder stage.
126
+
- **`build.gradle.kts` or `build.gradle` presence gates testing.** If neither file exists, Gradle commands are skipped.
127
+
- **ktlint uses `.editorconfig` for configuration.** Consistent with DevRail's `.editorconfig`-first approach.
128
+
- **All tools are pre-installed in the dev-toolchain container.** Do not install them on the host.
129
+
- For cross-cutting coding practices and git workflow standards that apply to all languages, see [Coding Practices](/docs/standards/practices/).
0 commit comments