Help us understand the problem. What is going on with this article?

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

More than 5 years have passed since last update.

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なども共通ルールが推奨される
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした