Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b381812
test: add 10 more tests for email_processor.py to improve coverage
KHolodilin Jan 21, 2026
d4c3fde
style: format test_email_processor_additional.py with ruff
KHolodilin Jan 21, 2026
cd516e7
test: add 5 more tests to improve coverage
KHolodilin Jan 21, 2026
65954f7
test: improve fingerprint.py coverage to 100%
KHolodilin Jan 21, 2026
c1a2045
Fix undefined mock_print variable in test_passwords.py
KHolodilin Jan 22, 2026
6070593
Fix linting errors: unused variables and code simplification
KHolodilin Jan 22, 2026
78766ad
Fix linting errors: unused variable and import location
KHolodilin Jan 22, 2026
5b15898
Add ruff check to pre-commit hooks and ignore PLC0415 for imap.py
KHolodilin Jan 22, 2026
1aaf466
Format test_passwords.py with ruff
KHolodilin Jan 22, 2026
fe6026e
docs: add mandatory pre-commit and ruff format checks before commit
KHolodilin Jan 22, 2026
3ae3369
docs: mark pre-commit hooks as required
KHolodilin Jan 22, 2026
ad831a0
docs: update README with new command structure and quick start guide
KHolodilin Jan 22, 2026
001eec2
docs: fix remaining old command references in README
KHolodilin Jan 22, 2026
b67a3df
fix: update test mocks to use correct ConfigLoader patch path
KHolodilin Jan 22, 2026
5430955
fix: improve test error messages and ensure file existence checks
KHolodilin Jan 22, 2026
925378c
fix: correct test assertions for UI methods and integration tests - F…
KHolodilin Jan 22, 2026
ac0f003
fix: correct get_imap_password patch path and test assertions - Fix S…
KHolodilin Jan 22, 2026
ab2b4c5
fix: improve Path and stat.filemode patching in password permission t…
KHolodilin Jan 22, 2026
30ae30b
fix: use function factory instead of class for Path patching in passw…
KHolodilin Jan 22, 2026
6461396
fix: use MagicMock with side_effect for Path patching in password tes…
KHolodilin Jan 22, 2026
d0249be
fix: correct indentation and variable name in permission warning test…
KHolodilin Jan 22, 2026
186f80b
fix: rename mock_filemode to mock_filemode_patch in first test too - …
KHolodilin Jan 22, 2026
8442da2
fix: remove global stat.filemode patch decorator from permission test…
KHolodilin Jan 22, 2026
90d5536
refactor: use UI instead of print for config validation warnings - Ad…
KHolodilin Jan 22, 2026
3ed319e
fix: update tests to expect ui parameter in ConfigLoader.load() - Upd…
KHolodilin Jan 22, 2026
4811e43
fix: improve permission warning tests - Add explicit assertions for s…
KHolodilin Jan 22, 2026
7e87e8a
fix: add detailed debugging to permission warning tests - Check actua…
KHolodilin Jan 23, 2026
d169fb3
fix: add detailed debugging to second permission warning test - Check…
KHolodilin Jan 23, 2026
d02fbf4
fix: patch CLIUI in __main__.py instead of cli.ui - CLIUI is imported…
KHolodilin Jan 23, 2026
def2759
fix: patch CLIUI in __main__.py for second permission warning test - …
KHolodilin Jan 23, 2026
52153e8
fix: correct indentation in path_factory function - Fix indentation f…
KHolodilin Jan 23, 2026
21205d2
fix: patch CLIUI in __main__.py for rich console permission test - Up…
KHolodilin Jan 23, 2026
be3f77d
chore: bump version to 8.0.1 - Update version in __version__.py and p…
KHolodilin Jan 23, 2026
295cf9d
test: add comprehensive integration tests - Add test_cli_integration.…
KHolodilin Jan 23, 2026
98c495d
Add tests for uncovered lines and configure CI coverage check
KHolodilin Jan 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: Run tests
run: |
pytest --tb=short -v --cov=email_processor --cov-report=term-missing --cov-report=xml --cov-fail-under=70
pytest --tb=short -v --cov=email_processor --cov-report=term-missing --cov-report=xml --cov-fail-under=95

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
Expand Down
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ repos:
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format

- repo: local
hooks:
- id: ruff-check
name: ruff check
entry: python -m ruff check .
language: system
pass_filenames: false
always_run: true

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
Expand Down
63 changes: 53 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,23 @@ MyPy is configured via `.mypy.ini` and `pyproject.toml`.
mypy email_processor
```

### 3. Pre-commit Hooks (Optional)
### 3. Pre-commit Hooks (Required)

Pre-commit hooks automatically run code quality checks before each commit.
Pre-commit hooks automatically run code quality checks before each commit. **It is required to run pre-commit checks before committing and pushing.**

```bash
# Install pre-commit
pip install pre-commit

# Install git hooks
# Install git hooks (optional - hooks will run automatically on commit)
pre-commit install

# Run hooks manually
# Run hooks manually (REQUIRED before commit and push)
pre-commit run --all-files
```

**Note:** Even if hooks are installed, always run `pre-commit run --all-files` manually before committing to ensure all checks pass.

### 4. Running Tests

```bash
Expand All @@ -83,33 +85,74 @@ pytest
pytest --cov=email_processor --cov-report=html

# Run specific test file
pytest tests/unit/processor/test_email_processor.py
pytest tests/unit/imap/test_fetcher_header.py

# Run all fetcher tests
pytest tests/unit/imap/test_fetcher_*.py

# Run specific test category
pytest tests/unit/imap/test_fetcher_attachment.py
```

### 5. Code Quality Workflow

Before committing:
**⚠️ IMPORTANT: Before committing and pushing, always run these checks:**

1. **Format code**:
1. **Check formatting** (required):
```bash
ruff format --check .
```
If files need formatting, run:
```bash
ruff format .
```

2. **Lint code**:
2. **Run pre-commit checks** (required):
```bash
pre-commit run --all-files
```
This will run all hooks including:
- Trailing whitespace check
- End of file fixer
- Ruff linting and formatting
- Ruff check (full project check)
- MyPy type checking

3. **Lint code** (if pre-commit didn't fix everything):
```bash
ruff check --fix .
```

3. **Type check** (optional):
4. **Type check** (optional, also runs in pre-commit):
```bash
mypy email_processor
```

4. **Run tests**:
5. **Run tests**:
```bash
pytest
```

**Recommended workflow:**
```bash
# 1. Check formatting first
ruff format --check .

# 2. If needed, format code
ruff format .

# 3. Run all pre-commit checks
pre-commit run --all-files

# 4. Run tests
pytest

# 5. Only then commit and push
git add .
git commit -m "your message"
git push
```

### 6. IDE Integration

#### VS Code
Expand Down
8 changes: 4 additions & 4 deletions PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,11 @@ git push origin feature/issue-3-add-project-documentation
### Задачи:
- [ ] Добавить бейджи в начало README.md
- PyPI version badge: `[![PyPI](https://img.shields.io/pypi/v/email-processor)](https://pypi.org/project/email-processor/)`
- CI status badge: `[![CI](https://github.com/vkholodilin/python-email-automation-processor/actions/workflows/ci.yml/badge.svg)](https://github.com/vkholodilin/python-email-automation-processor/actions/workflows/ci.yml)`
- Test Coverage badge: `[![Test Coverage](https://codecov.io/gh/vkholodilin/python-email-automation-processor/branch/main/graph/badge.svg)](https://codecov.io/gh/vkholodilin/python-email-automation-processor)`
- CI status badge: `[![CI](https://github.com/KHolodilin/python-email-automation-processor/actions/workflows/ci.yml/badge.svg)](https://github.com/KHolodilin/python-email-automation-processor/actions/workflows/ci.yml)`
- Test Coverage badge: `[![Test Coverage](https://codecov.io/gh/KHolodilin/python-email-automation-processor/branch/main/graph/badge.svg)](https://codecov.io/gh/KHolodilin/python-email-automation-processor)`
- Python version badge: `[![Python Version](https://img.shields.io/badge/python-3.9%2B-blue.svg)](https://www.python.org/downloads/)`
- License badge: `[![License](https://img.shields.io/github/license/vkholodilin/python-email-automation-processor)](LICENSE)`
- Stars badge: `[![Stars](https://img.shields.io/github/stars/vkholodilin/python-email-automation-processor)](https://github.com/vkholodilin/python-email-automation-processor/stargazers)`
- License badge: `[![License](https://img.shields.io/github/license/KHolodilin/python-email-automation-processor)](LICENSE)`
- Stars badge: `[![Stars](https://img.shields.io/github/stars/KHolodilin/python-email-automation-processor)](https://github.com/KHolodilin/python-email-automation-processor/stargazers)`
- Code style badge (Ruff): `[![Code style: Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)`
- [ ] Проверить корректность ссылок
- Убедиться, что все ссылки указывают на правильные репозитории
Expand Down
Loading
Loading