# Contributing to slpkg

Thank you for your interest in contributing to slpkg! The following guidelines will help you get started.

## Reporting Bugs

Open an issue on the [GitLab issue tracker](https://gitlab.com/dslackw/slpkg/-/issues). Please include:

- A clear description of the problem and steps to reproduce it.
- The output of `slpkg version` and your Slackware version.
- Any relevant error messages or log output.

## Suggesting Features

Open an issue with the label `enhancement` and describe:

- The use case and why the feature would be useful.
- Any alternative approaches you have considered.

## Submitting a Merge Request

1. Fork the repository and create a branch from `develop` (not `master`).
2. Make your changes, following the code style guidelines below.
3. Ensure all tests pass before submitting.
4. Open a Merge Request against the `develop` branch with a clear description of your changes.

## Development Setup

```bash
# Clone the repository
git clone https://gitlab.com/dslackw/slpkg.git
cd slpkg

# Create and activate a virtual environment
python3 -m venv ~/.venv/slpkg-dev
source ~/.venv/slpkg-dev/bin/activate

# Install the project in editable mode with optional dependencies
pip install -e ".[PySocks,pythondialog]"

# Install development tools
pip install flake8 mypy pylint pytest
```

## Code Style

This project uses [flake8](https://flake8.pycqa.org/) and [pylint](https://pylint.readthedocs.io/) for linting, and [mypy](https://mypy-lang.org/) for static type checking.

```bash
# Lint with flake8
flake8 slpkg/

# Lint with pylint
pylint slpkg/

# Type check
mypy slpkg/
```

Key conventions:

- Line length: 120 characters.
- Use `pathlib.Path` instead of `os.path` for filesystem operations.
- Use `X | None` instead of `Optional[X]` (requires `from __future__ import annotations`).
- Add type annotations to all function signatures.

## Running Tests

The test suite uses [pytest](https://pytest.org/) and lives in `tests_pytest/`:

```bash
pytest tests_pytest/ -v
```

All tests must pass before a Merge Request can be merged.

## Questions

For general questions, open an issue or contact the maintainer at [dslackw@gmail.com](mailto:dslackw@gmail.com).
