@@ -222,9 +222,9 @@ pytest tests/test_<service>.py -v
222222
223223## Pre-commit Requirements
224224
225- ** IMPORTANT: You MUST run the black linter and ensure it passes before committing any code.**
225+ ** IMPORTANT: You MUST run all linters and ensure they pass before committing any code.**
226226
227- ### Black Linter
227+ ### Black Formatter
228228
229229All Python code must be formatted with black before committing. This is a strict requirement - commits with unformatted code are not acceptable.
230230
@@ -239,17 +239,43 @@ black .
239239black emulator/ tests/
240240```
241241
242+ ### Ruff Linter
243+
244+ All Python code must pass ruff linting checks. Ruff catches common errors and enforces code quality standards.
245+
246+ ``` bash
247+ # Check for linting errors
248+ ruff check emulator tests
249+
250+ # Auto-fix some issues (where possible)
251+ ruff check --fix emulator tests
252+ ```
253+
254+ Common ruff issues to avoid:
255+ - ** E741** : Ambiguous variable names (e.g., use ` listener ` instead of ` l ` )
256+ - ** F841** : Unused variables (remove or use them)
257+
258+ ### Mypy Type Checker
259+
260+ All Python code must pass mypy type checking.
261+
262+ ``` bash
263+ # Run mypy type checker
264+ mypy emulator --ignore-missing-imports
265+ ```
266+
242267### Pre-commit Checklist
243268
244- Before every commit, you MUST:
269+ Before every commit, you MUST run these commands in order :
245270
246- 1 . ** Run black formatter** : ` black . `
247- 2 . ** Verify formatting passes** : ` black --check . `
248- 3 . ** Run tests** : ` pytest `
271+ 1 . ** Run black formatter** : ` black emulator tests `
272+ 2 . ** Run ruff linter** : ` ruff check emulator tests `
273+ 3 . ** Run mypy type checker** : ` mypy emulator --ignore-missing-imports `
274+ 4 . ** Run tests** : ` pytest `
249275
250- If ` black --check . ` reports any formatting issues, run ` black . ` to fix them before committing .
276+ All four checks must pass before committing. Fix any errors before proceeding .
251277
252- ** DO NOT commit code that fails black formatting checks. This is mandatory.**
278+ ** DO NOT commit code that fails any of these checks. This is mandatory.**
253279
254280## Patterns and Best Practices
255281
0 commit comments