Skip to content

Instantly share code, notes, and snippets.

@anatoliykant
Created November 5, 2020 18:06
Show Gist options
  • Save anatoliykant/e05f1ce034132b021c5371fde0083c2c to your computer and use it in GitHub Desktop.
Save anatoliykant/e05f1ce034132b021c5371fde0083c2c to your computer and use it in GitHub Desktop.
custom_rules:
rus_character_c:
name: "Russian char С"
regex: '([Сс])'
match_kinds:
- identifier
- parameter
message: "Wrong character 'с'"
severity: error
print_using:
name: "Print using"
regex: 'print\(.*\)'
message: "Print decrease performance of the app"
severity: warning
image_name_initialization:
name: "Image initialization without SwiftGen"
regex: 'UIImage\(named:[^)]+\)'
message: "Use SwiftGen UIImageView(image: Asset.someImage.image)"
severity: warning
image_literal_initialization:
name: "Image Literal initialization without SwiftGen"
regex: '#imageLiteral\(resourceName:[^)]+\)'
message: "Use SwiftGen UIImageView(image: Asset.someImage.image)"
severity: warning
color_literal_using:
name: "colorLiteral using"
regex: '#colorLiteral\(.*\)'
message: "Use SwiftGen ColorName.someColor.color"
severity: warning
numbers_smell:
name: "Numbers smell"
regex: '(case|return)\s-?\d{1,}'
message: "Numbers smell. Define a constant instead."
severity: warning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment