LoginSignup
26
29

More than 5 years have passed since last update.

プロジェクトで統一した方が良い設定(空白の扱い)

Last updated at Posted at 2012-08-09

gitなどでソース管理をする上で、空白のルールが統一されていないと空白に関するdiffが増えて、ソース管理の邪魔になりやすいので、以下の設定は必要に応じてチームで決めた方が良い。(マージ時にCONFLICTしにくい)

Preferences.sublime-settings
{
    "draw_white_space": "all",
    "ensure_newline_at_eof_on_save": true,
    "tab_size": 2,
    "translate_tabs_to_spaces": true,
    "trim_trailing_white_space_on_save": true,
    ...
}

  • draw_white_space 空白(タブ、スペース)を可視化
  • ensure_newline_at_eof_on_save 最後の行を空白行にして保存
  • tab_size 空白サイズ
  • translate_tabs_to_spaces タブをスペースに変換
  • trim_trailing_white_space_on_save 行末の空白を保存時に削除

その他

  • チーム外で作られたファイルを改変する場合は、空白の扱いルールが違う場合があるので、必要に応じて設定を変更する
  • "folder_exclude_patterns", "file_exclude_patterns"も統一してもいい
  • .gitignore, .gitignore_globalなども共通ルールが推奨される
26
29
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
26
29