LoginSignup
2
0

More than 5 years have passed since last update.

[Swift]returnの前に空行がなかったら怒られたい[Lint]

Posted at

swiftlintでreturnの前に空行がなかったら怒られたい人用

custom_rules:
        blank_before_return:
                name: "Needs blank bfore return"
                regex: '\S+\R[ \t]*return'
                severity: error

でも、switch-caseでcaseにreturnだけだったら怒られたくない人用

custom_rules:
        blank_before_return:
                name: "Needs blank bfore return"
                regex: '\S+[^:]\R[ \t]*return'
                severity: error

下のだと、これは怒られない

switch value {

    case 1:
        return 1

    default:
        return 0
}
2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0