Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
paths:
- '.github/workflows/swiftlint.yml'
- 'NativeAppTemplate/.swiftlint.yml'
- '.swiftlint.yml'
- 'NativeAppTemplate/**/*.swift'

jobs:
Expand Down
46 changes: 46 additions & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# SwiftFormat Configuration for NativeAppTemplate

# Swift version
--swiftversion 6.0

# Indentation
--indent 4
--indentcase false
--trimwhitespace always

# Operators
--nospaceoperators ...,..
--ranges spaced

# File header
--header "//\n// {file}\n// NativeAppTemplate\n//"

# Excluded paths
--exclude Pods,Carthage,DerivedData,.build

# Formatting rules
--allman false
--maxwidth 120
--wraparguments before-first
--wrapparameters before-first
--wrapcollections before-first
--closingparen balanced
--commas always
--decimalgrouping 3,4
--exponentcase lowercase
--fractiongrouping disabled
--hexliteralcase lowercase
--ifdef no-indent
--linebreaks lf
--octalgrouping 4,8
--operatorfunc spaced
--patternlet hoist
--self remove
--semicolons never
--stripunusedargs closure-only
--trailingclosures
--commas inline
--xcodeindentation disabled

# Disabled rules to avoid conflicts with SwiftLint
--disable wrapMultilineStatementBraces
67 changes: 67 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# SwiftLint Configuration for NativeAppTemplate

# Disabled rules
disabled_rules:
- trailing_whitespace
- todo

# Opt-in rules for better code quality
opt_in_rules:
- empty_count
- empty_string
- explicit_init
- first_where
- closure_spacing
- redundant_nil_coalescing
- vertical_whitespace_closing_braces
- vertical_whitespace_opening_braces

# Included paths
included:
- NativeAppTemplate

# Excluded paths
excluded:
- Pods
- Carthage
- DerivedData
- .build

# Configured rules
line_length:
warning: 120
error: 150

function_body_length:
warning: 100
error: 300

type_body_length:
warning: 450
error: 500

file_length:
warning: 650
error: 1000

type_name:
max_length:
warning: 50

cyclomatic_complexity:
warning: 15
error: 25

large_tuple:
warning: 3
error: 4

identifier_name:
min_length:
warning: 2
max_length:
warning: 50
excluded:
- by
- id
- db
51 changes: 51 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Changelog

All notable changes to NativeAppTemplate will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- SwiftFormat for code formatting (with `--maxwidth 120`)
- `@preconcurrency import CoreNFC` and `nonisolated(unsafe)` for Sendable fixes

### Changed
- Moved `.swiftlint.yml` to repository root with updated rules
- Applied SwiftFormat across all source files
- Fixed all SwiftLint violations (line length, cyclomatic complexity, etc.)

## [1.1.0] - 2025-07-26

### Changed
- Updated for iOS 18 support
- Bug fixes

## [1.0.0] - 2024-10-30

### Added
- Initial release of NativeAppTemplate
- 100% Swift, 99% SwiftUI (UIKit only for email screen via MessageUI)
- `@Observable` macro (iOS 17+) for state management
- MVVM architecture with repository pattern
- Onboarding flow
- Sign Up / Sign In / Sign Out
- Email Confirmation
- Forgot Password
- Input Validation
- CRUD operations for Shops
- URL path-based multitenancy
- User invitation to organizations
- Role-based permissions and access control
- NFC tag reading and writing
- SwiftLint integration
- Swift Testing framework for unit tests
- GitHub Actions CI for automated testing

### Technical
- Protocol-oriented repository pattern for testability
- DataManager as central dependency injection container
- Token-based authentication with automatic refresh
- NavigationStack with path-based routing
- JSON:API adapter layer
10 changes: 8 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,16 @@ xcodebuild -project NativeAppTemplate.xcodeproj \
### Linting
```bash
# Run SwiftLint (must be installed via: brew install swiftlint)
cd NativeAppTemplate && swiftlint
swiftlint

# Run SwiftLint with strict mode (as in CI)
cd NativeAppTemplate && swiftlint --strict
swiftlint --strict
```

### Formatting
```bash
# Run SwiftFormat (must be installed via: brew install swiftformat)
swiftformat .
```

## Architecture Overview
Expand Down
32 changes: 0 additions & 32 deletions NativeAppTemplate.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,6 @@
011F6DE9259EF16400BED22E /* Sources */,
011F6DEA259EF16400BED22E /* Frameworks */,
011F6DEB259EF16400BED22E /* Resources */,
01A77D352632D1D900352EBC /* SwiftLint Run Script */,
);
buildRules = (
);
Expand Down Expand Up @@ -962,37 +961,6 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
01A77D352632D1D900352EBC /* SwiftLint Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
name = "SwiftLint Run Script";
shellPath = /bin/sh;
shellScript = (
"if [[ \"$(uname -m)\" == arm64 ]]; then",
" export PATH=\"/opt/homebrew/bin:$PATH\"",
"fi",
"",
"if which swiftlint > /dev/null; then",
" swiftlint",
"else",
" echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"",
"fi",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
);
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand Down
108 changes: 0 additions & 108 deletions NativeAppTemplate/.swiftlint.yml

This file was deleted.

Loading
Loading