---
title: Use 2 spaces for indentation
impact: LOW
impactDescription: Follow Ruby community standard for code formatting.
tags: ruby, formatting, indentation, style
---

## Use 2 spaces for indentation

Follow Ruby community standard for code formatting. Use 2 spaces for indentation, never tabs. Ensure consistent indentation throughout the codebase.

**Incorrect:**

```ruby
def hello
	puts "hello" # Tab used
end

def world
    puts "world" # 4 spaces used
end
```

**Correct:**

```ruby
def hello
  puts "hello" # 2 spaces
end
```

**Tools:** RuboCop (`Layout/IndentationWidth`)
