aboutsummaryrefslogtreecommitdiff
path: root/.swiftlint.yml
diff options
context:
space:
mode:
Diffstat (limited to '.swiftlint.yml')
-rw-r--r--.swiftlint.yml36
1 files changed, 36 insertions, 0 deletions
diff --git a/.swiftlint.yml b/.swiftlint.yml
new file mode 100644
index 0000000..51b479a
--- /dev/null
+++ b/.swiftlint.yml
@@ -0,0 +1,36 @@
+# SwiftLint configuration for NorgKit.
+# Tuned to the existing style rather than forcing churn: the parsers use short,
+# conventional cursor names (i, j, lo, hi, c, s, m) and the recogniser functions
+# are intentionally long, flat state machines.
+
+included:
+ - Sources
+ - Tests
+ - Benchmarks
+
+identifier_name:
+ # Allow short loop/cursor names that read clearly in tight parsing loops.
+ min_length:
+ warning: 1
+ error: 1
+
+line_length:
+ warning: 120
+ error: 160
+ ignores_comments: true
+ ignores_urls: true
+
+function_body_length:
+ warning: 80
+ error: 120
+
+cyclomatic_complexity:
+ warning: 15
+ error: 25
+
+disabled_rules:
+ # "TODO" appears in doc comments describing Norg's TODO-status syntax.
+ - todo
+ # Trailing commas are used selectively (e.g. the modifier tables); leave the
+ # choice to the author rather than enforcing one way.
+ - trailing_comma