aboutsummaryrefslogtreecommitdiff
path: root/.swiftlint.yml
blob: 51b479a34c883a7ae3318bf1751f133cf73bbb7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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