Skip to content
Draft
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
20 changes: 20 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|MultiEdit|Write",
"hooks": [
{
"type": "command",
"command": "jq -r '.tool_input.file_path // .tool_response.filePath // empty' | { read -r f; case \"$f\" in *.swift) command -v swiftformat >/dev/null && swiftformat \"$f\";; esac; }"
},
{
"type": "command",
"command": "jq -r '.tool_input.file_path // .tool_response.filePath // empty' | { read -r f; case \"$f\" in *.swift) if [ -f \"${CLAUDE_PROJECT_DIR:-.}/.swiftlint.yml\" ]; then command -v swiftlint >/dev/null && swiftlint lint --strict --quiet \"$f\"; fi;; esac; }"
}
]
}
]
}
}
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
61 changes: 61 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Bug Report
description: Report incorrect behavior in KarrotCodableKit
labels: ["Bug"]
body:
- type: input
id: version
attributes:
label: KarrotCodableKit version
placeholder: "2.1.0"
validations:
required: true
- type: input
id: toolchain
attributes:
label: Swift / Xcode version
placeholder: "Swift 6.2 / Xcode 26.3"
validations:
required: true
- type: input
id: platform
attributes:
label: Platform and OS version
placeholder: "iOS 18.5 simulator"
validations:
required: false
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Describe the actual behavior. Include the full error output (e.g. the `DecodingError`) if any.
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Minimal reproducible code
description: The smallest type + decoding/encoding code that reproduces the issue.
render: swift
validations:
required: true
- type: textarea
id: json
attributes:
label: JSON payload
description: The JSON involved, if the bug is about decoding or encoding.
render: json
validations:
required: false
- type: textarea
id: expected
attributes:
label: Expected behavior
validations:
required: true
- type: checkboxes
id: checks
attributes:
label: Checklist
options:
- label: I searched existing issues and found no duplicate.
required: true
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: true
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Feature Request
description: Suggest new functionality for KarrotCodableKit
labels: ["Feature"]
body:
- type: textarea
id: motivation
attributes:
label: Problem / motivation
description: What problem would this solve? What are you trying to do that is currently hard or impossible?
validations:
required: true
- type: textarea
id: proposal
attributes:
label: Proposed API or solution
description: Sketch the API you have in mind, if any.
render: swift
validations:
required: false
- type: textarea
id: alternatives
attributes:
label: Alternatives considered
validations:
required: false
- type: checkboxes
id: contribution
attributes:
label: Contribution
options:
- label: I am willing to submit a PR for this.
required: false
7 changes: 7 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@
## Review Notes
<!-- Include any information that would help with the review. -->
-

## Checklist
<!-- Check what applies to this PR. -->
- [ ] `swift test -c debug` and `swift test -c release` pass (test counts reported above)
- [ ] Changes are covered by tests (for bug fixes: a regression test written first)
- [ ] `swiftformat .` produces no diff
- [ ] Docs updated if the public API changed
137 changes: 137 additions & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# SwiftFormat configuration for KarrotCodableKit.
#
# Based on the Karrot house style applied across this codebase in PR #30
# (SwiftFormat 0.62.x). Uses an explicit rule whitelist: only the rules listed
# under "rules" below run; everything else is disabled.
#
# `swiftformat .` must stay idempotent on a clean tree. Verify with:
# swiftformat --lint .
#
# Deliberate deviations from the house baseline, so the existing tree stays
# untouched: isEmpty, wrapIfStatementBodies, and elseOnSameLine are not
# enabled (tests intentionally assert `count == 0` for better failure
# messages, and a few single-line if/else bodies are kept as written).

# options
--min-version 0.62.0
--swift-version 6.2
--language-mode 5
--self remove # redundantSelf
--import-grouping testable-bottom # sortedImports
--trailing-commas multi-element-lists # trailingCommas
--trim-whitespace always # trailingSpace
--indent 2 #indent
--ifdef no-indent #indent
--indent-strings true #indent
--wrap-arguments before-first # wrapArguments
--wrap-parameters before-first # wrapArguments
--wrap-collections before-first # wrapArguments
--wrap-conditions before-first # wrapArguments
--wrap-return-type never #wrapArguments
--wrap-effects never #wrapArguments
--closing-paren balanced # wrapArguments
--call-site-paren balanced # wrapArguments
--wrap-type-aliases before-first # wrapArguments
--func-attributes prev-line # wrapAttributes
--computed-var-attributes prev-line # wrapAttributes
--stored-var-attributes preserve # wrapAttributes
--complex-attributes prev-line # wrapAttributes
--type-attributes prev-line # wrapAttributes
--wrap-ternary before-operators # wrap
--extension-acl on-declarations # extensionAccessControl
--pattern-let inline # hoistPatternLet
--property-types infer-locals-only # redundantType, propertyTypes
--strip-unused-args closure-only # unusedArguments
--type-blank-lines preserve # blankLinesAtStartOfScope, blankLinesAtEndOfScope
--ranges preserve # spaceAroundOperators
--some-any disabled # opaqueGenericParameters
--single-line-for-each convert # preferForLoop
--short-optionals always # typeSugar
--semicolons never # semicolons
--doc-comments preserve # docComments
--max-width 120 # wrap
--modifier-order private,fileprivate,internal,package,public,open,private(set),fileprivate(set),internal(set),package(set),public(set),open(set),override,final,dynamic,optional,required,convenience,indirect,isolated,nonisolated,nonisolated(unsafe),lazy,weak,unowned,unowned(safe),unowned(unsafe),static,class,borrowing,consuming,mutating,nonmutating,prefix,infix,postfix,async # modifierOrder

# rules
--rules anyObjectProtocol
--rules blankLinesBetweenScopes
--rules consecutiveSpaces
--rules consecutiveBlankLines
--rules duplicateImports
--rules extensionAccessControl
--rules environmentEntry
--rules hoistPatternLet
--rules indent
--rules redundantParens
--rules redundantReturn
--rules redundantSelf
--rules redundantType
--rules redundantPattern
--rules redundantGet
--rules redundantFileprivate
--rules redundantRawValues
--rules redundantEquatable
--rules sortImports
--rules sortDeclarations
--rules strongifiedSelf
--rules trailingCommas
--rules trailingSpace
--rules linebreakAtEndOfFile
--rules typeSugar
--rules wrap
--rules wrapMultilineStatementBraces
--rules wrapArguments
--rules wrapAttributes
--rules wrapLoopBodies
--rules braces
--rules redundantClosure
--rules redundantInit
--rules redundantVoidReturnType
--rules redundantOptionalBinding
--rules redundantInternal
--rules redundantVariable
--rules unusedArguments
--rules spaceInsideBrackets
--rules spaceInsideBraces
--rules spaceAroundBraces
--rules spaceInsideParens
--rules spaceAroundParens
--rules spaceAroundOperators
--rules enumNamespaces
--rules blockComments
--rules docComments
--rules docCommentsBeforeModifiers
--rules spaceAroundComments
--rules spaceInsideComments
--rules blankLinesAtStartOfScope
--rules blankLinesAtEndOfScope
--rules emptyBraces
--rules andOperator
--rules opaqueGenericParameters
--rules genericExtensions
--rules trailingClosures
--rules sortTypealiases
--rules preferForLoop
--rules conditionalAssignment
--rules wrapMultilineConditionalAssignment
--rules void
--rules blankLineAfterSwitchCase
--rules consistentSwitchCaseSpacing
--rules semicolons
--rules propertyTypes
--rules blankLinesBetweenChainedFunctions
--rules emptyExtensions
--rules preferCountWhere
--rules preferFirstWhere
--rules preferContains
--rules swiftTestingTestCaseNames
--rules modifiersOnSameLine
--rules noForceTryInTests
--rules noForceUnwrapInTests
--rules redundantThrows
--rules redundantAsync
--rules noGuardInTests
--rules redundantMemberwiseInit
--rules redundantTypedThrows
--rules redundantBreak
--rules preferFinalClasses
Loading