chore(rules): track shared-rules baseline v1.1.0

This commit is contained in:
Mihaela Mihaljevic 2026-07-02 21:38:06 +02:00
parent b13990da28
commit 95e9bcabae
4 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,24 @@
# Managed by rules-swift (scripts/sync-rules.sh). Verifies this repo tracks the
# CURRENT shared-rules baseline. The repo's own .swiftformat/.swiftlint.yml are
# repo-specific (baseline + project rules) and are intentionally NOT byte-checked.
name: rules-conformance
on:
push:
pull_request:
workflow_dispatch:
jobs:
rules:
runs-on: macos
steps:
- uses: actions/checkout@v4
- name: Rules baseline freshness (VERSION)
run: |
BASE=https://codeberg.org/Mihaela/rules-swift/raw/branch/main
canon=$(curl -fsSL "$BASE/VERSION" | tr -d '[:space:]')
mine=$(tr -d '[:space:]' < .rules-version 2>/dev/null || echo MISSING)
if [ "$mine" != "$canon" ]; then
echo "STALE: shared-rules baseline is v$canon, this repo tracks v$mine."
echo "Review the baseline diff, fold it into this repo's rules, then set .rules-version to $canon."
exit 1
fi
echo "rules baseline FRESH at v$canon (repo-specific rules preserved, not checked)"

1
.rules-version Normal file
View File

@ -0,0 +1 @@
1.1.0

12
.swiftformat Normal file
View File

@ -0,0 +1,12 @@
# SwiftFormat configuration. https://github.com/nicklockwood/SwiftFormat
# This is a starting point; adjust to your project, but keep it committed so
# every clone and CI run formats identically.
--swiftversion 6.0
--indent 4
--maxwidth 180
--commas always
--self remove
--importgrouping testable-bottom
--trailingclosures
--exclude .build,Packages/.build,.git

31
.swiftlint.yml Normal file
View File

@ -0,0 +1,31 @@
# SwiftLint configuration. https://github.com/realm/SwiftLint
# A starting point; tune to your project, but keep it committed and run it with
# --strict so warnings cannot accumulate.
disabled_rules:
- todo
opt_in_rules:
- empty_count
- explicit_init
- first_where
- force_unwrapping
- sorted_first_last
- unused_import
line_length:
warning: 180
error: 220
ignores_comments: true
ignores_urls: true
identifier_name:
min_length: 2
type_name:
min_length: 2
excluded:
- .build
- Packages/.build
- .git