|
| 1 | +# By default, SwiftLint uses a set of sensible default rules you can adjust: |
| 2 | +disabled_rules: # rule identifiers turned on by default to exclude from running |
| 3 | + - colon |
| 4 | + - comma |
| 5 | + - control_statement |
| 6 | +opt_in_rules: # some rules are turned off by default, so you need to opt-in |
| 7 | + - empty_count # Find all the available rules by running: `swiftlint rules` |
| 8 | + |
| 9 | +# Alternatively, specify all rules explicitly by uncommenting this option: |
| 10 | +# only_rules: # delete `disabled_rules` & `opt_in_rules` if using this |
| 11 | +# - empty_parameters |
| 12 | +# - vertical_whitespace |
| 13 | + |
| 14 | +# included: # paths to include during linting. `--path` is ignored if present. |
| 15 | +# - Sources |
| 16 | +excluded: # paths to ignore during linting. Takes precedence over `included`. |
| 17 | + - Carthage |
| 18 | + - Pods |
| 19 | + - Source/ExcludedFolder |
| 20 | + - Source/ExcludedFile.swift |
| 21 | + - Source/*/ExcludedFile.swift # Exclude files with a wildcard |
| 22 | + - R.generated.swift |
| 23 | + - .build |
| 24 | +analyzer_rules: # Rules run by `swiftlint analyze` |
| 25 | + - explicit_self |
| 26 | + |
| 27 | +# configurable rules can be customized from this configuration file |
| 28 | +# binary rules can set their severity level |
| 29 | +force_cast: warning # implicitly |
| 30 | +force_try: |
| 31 | + severity: warning # explicitly |
| 32 | +# rules that have both warning and error levels, can set just the warning level |
| 33 | +# implicitly |
| 34 | +line_length: 110 |
| 35 | +# they can set both implicitly with an array |
| 36 | +type_body_length: |
| 37 | + - 300 # warning |
| 38 | + - 400 # error |
| 39 | +# or they can set both explicitly |
| 40 | +file_length: |
| 41 | + warning: 500 |
| 42 | + error: 1200 |
| 43 | +# naming rules can set warnings/errors for min_length and max_length |
| 44 | +# additionally they can set excluded names |
| 45 | +type_name: |
| 46 | + min_length: 3 # only warning |
| 47 | + max_length: # warning and error |
| 48 | + warning: 40 |
| 49 | + error: 50 |
| 50 | + excluded: iPhone # excluded via string |
| 51 | + allowed_symbols: ["_"] # these are allowed in type names |
| 52 | +identifier_name: |
| 53 | + min_length: # only min_length |
| 54 | + error: 4 # only error |
| 55 | + excluded: # excluded via string array |
| 56 | + - tag |
| 57 | + - log |
| 58 | + - id |
| 59 | + - URL |
| 60 | + - GlobalAPIKey |
| 61 | +reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, codeclimate, junit, html, emoji, sonarqube, markdown, github-actions-logging) |
0 commit comments