Skip to content

Instantly share code, notes, and snippets.

@brindy
Created September 27, 2021 11:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brindy/c0dccfff2230ec9b437b040a5d6ed215 to your computer and use it in GitHub Desktop.
Save brindy/c0dccfff2230ec9b437b040a5d6ed215 to your computer and use it in GitHub Desktop.
swiftlint custom rules for explicit non-final classes
custom_rules:
explicit_non_final_class:
included: ".*\\.swift"
excluded: ".*Tests\\.swift"
name: "Implicitly non-final class"
regex: "^\\s*(class) (?!func|var)"
capture_group: 0
match_kinds:
- keyword
message: "Classes should be `final` by default, use explicit `internal` or `public` for non-final classes."
severity: error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment