次のようなクラスがあるとします。
class person{
}
コードをチェックして、クラス名にキャメルケースを使用していることを警告するポリシーを実装する必要があります (person の代わりに Person を使用) Swift でそれを行うにはどうすればよいですか?
次のようなクラスがあるとします。
class person{
}
コードをチェックして、クラス名にキャメルケースを使用していることを警告するポリシーを実装する必要があります (person の代わりに Person を使用) Swift でそれを行うにはどうすればよいですか?
SwiftLint
あらゆる種類のコーディング ガイドラインを利用していると思います。また、yml
ファイルにルールを設定することもできます。詳細については、 SwiftLintを参照してください。
例として、yml
ファイルは次のようになります。
opt_in_rules:
- force_unwrapping
- empty_count
- explicit_init
- closure_spacing
- overridden_super_call
- redundant_nil_coalescing
- nimble_operator
- attributes
- operator_usage_whitespace
- closure_end_indentation
- first_where
- object_literal
- number_separator
- prohibited_super_call
- fatal_error_message
disabled_rules:
- type_name
- trailing_whitespace
- identifier_name
- class_delegate_protocol
- nesting
file_length:
warning: 1000
error: 1200
type_body_length:
- 200 # warning
- 300 # error
identifier_name:
excluded:
- id
line_length: 300
number_separator:
minimum_length: 5
function_parameter_count:
warning: 6
error: 9