.qlty/qlty.toml
77 lines · 1972 bytes
1config_version = "0"
2
3exclude_patterns = [
4 "**/.build/**",
5 ".claude/**",
6 # Vendored tree-sitter grammars and scanners (THIRD_PARTY.org).
7 "Sources/TreeSitterClojure/**",
8 "Sources/TreeSitterElisp/**",
9 "Sources/TreeSitterScanners/**",
10]
11
12test_patterns = [
13 "Tests/**",
14]
15
16[smells]
17mode = "comment"
18
19# Early returns are guard clauses, which keep the happy path unindented.
20[smells.return_statements]
21enabled = false
22
23# Function and file complexity are left to review rather than counted.
24[smells.function_complexity]
25enabled = false
26
27[smells.file_complexity]
28enabled = false
29
30[[source]]
31name = "default"
32default = true
33
34[[plugin]]
35name = "swiftlint"
36
37[[plugin]]
38name = "shellcheck"
39
40[[plugin]]
41name = "trufflehog"
42
43# Style rules that flag most of the codebase without finding defects.
44[[triage]]
45match.plugins = ["swiftlint"]
46match.rules = [
47 "swiftlint:line_length",
48 "swiftlint:identifier_name",
49 "swiftlint:trailing_comma",
50 "swiftlint:todo",
51]
52match.file_patterns = ["**"]
53set.ignored = true
54
55# Tests use try! to fail fast.
56[[triage]]
57match.plugins = ["swiftlint"]
58match.rules = ["swiftlint:force_try"]
59match.file_patterns = ["Tests/**"]
60set.ignored = true
61
62# Exhaustive switch-over-enum lookup tables and the light and dark color tables share shape but not content.
63# FolderEntity is declared in each app target because App Intents reads its metadata from the target
64# that declares it; prettify draws through UIKit on iOS and AppKit on the Mac.
65[language.swift.smells.duplication]
66filter_patterns = [
67 "(import_declaration _)",
68 "(switch_statement _)",
69 "(dictionary_literal _)",
70 "(class_declaration name: (type_identifier) @_n (#eq? @_n \"FolderEntity\"))",
71 "(function_declaration name: (simple_identifier) @_n (#eq? @_n \"prettify\"))",
72]
73
74# tree-sitter-swift nests each `else if` inside the previous branch, so a one-line `if` in the
75# fourth branch of a flat chain reports level 5.
76[language.swift.smells.nested_control_flow]
77enabled = false