Skip to content

Instantly share code, notes, and snippets.

@PGMY
Created January 24, 2017 02:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PGMY/e8202c4c1856cbc3a1135095177cd85d to your computer and use it in GitHub Desktop.
Save PGMY/e8202c4c1856cbc3a1135095177cd85d to your computer and use it in GitHub Desktop.
disabled_rules: # 適用したくないチェック項目を記述
- force_try
- trailing_whitespace
- variable_name
opt_in_rules: # 採用するopt-inのルール
- empty_count
included: # Lint対象にするファイル プロジェクトpathを指定
- ##PRJ_NAME##
excluded: # Lint対象から外すファイルのあるパスを記述、CocoaPodsやCarthage
- Carthage
- Pods
- Source/ExcludedFolder
- Source/ExcludedFile.swift
force_cast: warning # implicitly
#force_try:
# severity: warning # explicitly
# 1行の文字数生ゲイン
line_length: 250
# クラスの行数
type_body_length:
- 300 # warning
- 400 # error
# 1ファイルの行数
file_length:
- 400 # warning
- 1000 # error
type_name:
min_length: 4 # only warning
max_length: # warning and error
warning: 40
error: 50
excluded: iPhone # excluded via string
variable_name:
min_length: # only min_length
error: 4 # only error
excluded: # excluded via string array
- id
- URL
- GlobalAPIKey
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle)
# if which swiftlint >/dev/null; then
# swiftlint
# else
# echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
# fi
# +-----------------------------+--------+-------------+------------------------+--------------------------------------------------+
# | identifier | opt-in | correctable | enabled in your config | configuration |
# +-----------------------------+--------+-------------+------------------------+--------------------------------------------------+
# | closing_brace | no | yes | yes | warning |
# | colon | no | yes | yes | warning | コロン : の後ろに空白スペースを入れる
# | comma | no | yes | yes | warning | コンマ , の後ろに空白スペースを入れる
# | conditional_binding_cascade | no | no | yes | warning |
# | control_statement | no | no | yes | warning | if,for,while,doの後ろの不必要な()を取り除く
# | custom_rules | no | no | yes | user-defined |
# | cyclomatic_complexity | no | no | yes | warning: 10, error: 20 |
# | empty_count | yes | no | no | error |
# | file_length | no | no | yes | warning: 400, error: 1000 |
# | force_cast | no | no | yes | error | as! -> as?
# | force_try | no | no | yes | error | try! -> try-catchで囲む
# | force_unwrapping | yes | no | no | warning |
# | function_body_length | no | no | yes | warning: 40, error: 100 |
# | function_parameter_count | no | no | yes | warning: 5, error: 8 |
# | leading_whitespace | no | no | yes | warning | ファイルの先頭の空白文字を取り除く
# | legacy_constant | no | yes | yes | warning |
# | legacy_constructor | no | yes | yes | warning |
# | line_length | no | no | yes | warning: 100, error: 200 |
# | missing_docs | yes | no | no | warning: public |
# | nesting | no | no | yes | warning |
# | opening_brace | no | yes | yes | warning |
# | operator_whitespace | no | no | yes | warning | オペレータ定義時に前後に1つの空白スペースを入れる
# | return_arrow_whitespace | no | no | yes | warning | 戻り値 -> の後ろに空白スペース
# | statement_position | no | yes | yes | warning |
# | todo | no | no | yes | warning |
# | trailing_newline | no | yes | yes | warning |
# | trailing_semicolon | no | yes | yes | warning |
# | trailing_whitespace | no | yes | yes | warning | 末尾の空白スペースを取り除く
# | type_body_length | no | no | yes | warning: 200, error: 350 |
# | type_name | no | no | yes | (min_length) w/e: 3/0, (max_length) w/e: 40/1000 |
# | valid_docs | no | no | yes | warning |
# | variable_name | no | no | yes | (min_length) w/e: 3/2, (max_length) w/e: 40/60 |
# +-----------------------------+--------+-------------+------------------------+--------------------------------------------------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment