|
| 1 | +# Contributing to FileSystemPro |
| 2 | + |
| 3 | +Thank you for considering contributing to **FileSystemPro**! We appreciate your interest in improving this cross-platform file system toolkit. Whether it's fixing bugs, adding features, enhancing documentation, or refining code, your contributions help make the library more robust and user-friendly. |
| 4 | + |
| 5 | +Before starting, please read this guide to understand our contribution process. By participating, you agree to abide by our [Code of Conduct](https://github.com/hbisneto/FileSystemPro/blob/main/CODE_OF_CONDUCT.md). |
| 6 | + |
| 7 | +## Code of Conduct |
| 8 | + |
| 9 | +We follow the [Contributor Covenant Code of Conduct ](https://www.contributor-covenant.org/version/2/1/code_of_conduct/). All contributors are expected to uphold this standard. If you encounter issues, contact us at [[email protected]](mailto:[email protected]) or via GitHub issues. |
| 10 | + |
| 11 | +## Ways to Contribute |
| 12 | + |
| 13 | +We welcome all kinds of contributions! Here are some ideas: |
| 14 | + |
| 15 | +- **Bug Reports**: Found an issue? [Open an issue](https://github.com/hbisneto/FileSystemPro/issues/new) with a clear description, steps to reproduce, and environment details (OS, Python version, `psutil` if used). |
| 16 | +- **Feature Requests**: Have an idea? [Suggest it here](https://github.com/hbisneto/FileSystemPro/issues/new?template=feature_request.md). Include use cases and rationale. |
| 17 | +- **Documentation**: Typos, clarifications, or new examples? Edit READMEs or submodule docs directly via PR. |
| 18 | +- **Code**: Implement features, fix bugs, or refactor. See below for details. |
| 19 | +- **Tests**: Add or improve tests in `tests/`. |
| 20 | +- **Other**: Translations, performance benchmarks, or tooling scripts. |
| 21 | + |
| 22 | +## Development Setup |
| 23 | + |
| 24 | +1. **Fork and Clone**: |
| 25 | + |
| 26 | + ```bash |
| 27 | + git clone https://github.com/YOUR_USERNAME/FileSystemPro.git |
| 28 | + cd FileSystemPro |
| 29 | + git remote add upstream https://github.com/hbisneto/FileSystemPro.git |
| 30 | + ``` |
| 31 | + |
| 32 | +2. **Virtual Environment**: |
| 33 | + |
| 34 | + ```bash |
| 35 | + python -m venv .venv |
| 36 | + source .venv/bin/activate # On Unix/macOS |
| 37 | + # Or: .venv\Scripts\activate # On Windows |
| 38 | + ``` |
| 39 | + |
| 40 | +3. **Install Dependencies**: |
| 41 | + |
| 42 | + ```bash |
| 43 | + pip install -e .[dev] # Editable install + dev extras (pytest, black, flake8) |
| 44 | + pip install psutil # Optional, for device module |
| 45 | + ``` |
| 46 | + |
| 47 | +4. **Verify Setup**: |
| 48 | + |
| 49 | + ```bash |
| 50 | + pytest tests/ # Run tests |
| 51 | + black --check . # Check formatting |
| 52 | + flake8 . # Lint |
| 53 | + ``` |
| 54 | + |
| 55 | +## Coding Standards |
| 56 | + |
| 57 | +- **Python Version**: Target 3.10+; test on 3.10, 3.12. |
| 58 | +- **Style Guide**: Follow [PEP 8](https://peps.python.org/pep-0008/). Use [Black](https://black.readthedocs.io/) for formatting: |
| 59 | + ```bash |
| 60 | + black . |
| 61 | + ``` |
| 62 | +- **Linting**: [Flake8](https://flake8.pycqa.org/) for style checks: |
| 63 | + ```bash |
| 64 | + flake8 . |
| 65 | + ``` |
| 66 | +- **Type Hints**: Use [mypy](https://mypy-lang.org/) where practical (not enforced yet). |
| 67 | +- **Docstrings**: [Google style](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings) for functions/classes. |
| 68 | +- **Commit Messages**: Conventional commits (e.g., `feat: add network monitoring`). |
| 69 | +- **Branches**: Feature branches from `main` (e.g., `feat/new-module`). |
| 70 | + |
| 71 | +## Making a Contribution |
| 72 | + |
| 73 | +1. **Discuss First**: For non-trivial changes, open an issue to align on scope. |
| 74 | + |
| 75 | +2. **Branch and Commit**: |
| 76 | + |
| 77 | + ```bash |
| 78 | + git checkout -b your-branch-name |
| 79 | + git add . |
| 80 | + git commit -m "feat: brief description" |
| 81 | + ``` |
| 82 | + |
| 83 | +3. **Test Locally**: |
| 84 | + |
| 85 | + - Run `pytest` to ensure no regressions. |
| 86 | + - Verify with examples from submodule READMEs. |
| 87 | + - Check cross-platform (e.g., via GitHub Actions or local VMs). |
| 88 | + |
| 89 | +4. **Push and PR**: |
| 90 | + |
| 91 | + ```bash |
| 92 | + git push origin your-branch-name |
| 93 | + ``` |
| 94 | + - Open a Pull Request (PR) to `main`. |
| 95 | + - Reference related issues (e.g., "Fixes #123"). |
| 96 | + - Include changelog entry if breaking (in `CHANGELOG.md`). |
| 97 | + |
| 98 | +5. **Review and Merge**: |
| 99 | + |
| 100 | + - Expect feedback; iterate as needed. |
| 101 | + - Once approved, merge via squash/rebase (maintain clean history). |
| 102 | + - Delete branch post-merge. |
| 103 | + |
| 104 | +## Pull Request Guidelines |
| 105 | + |
| 106 | +- **Title**: Clear and concise (e.g., "fix: resolve path resolution on Windows"). |
| 107 | +- **Description**: |
| 108 | + - What/Why: Problem solved and motivation. |
| 109 | + - How: Key changes. |
| 110 | + - Tests: New/updated tests. |
| 111 | + - Docs: Updated READMEs/examples. |
| 112 | +- **Scope**: Small, focused PRs (<300 lines preferred). |
| 113 | +- **CI Checks**: Must pass (linting, tests); re-run if needed. |
| 114 | + |
| 115 | +## Releasing |
| 116 | + |
| 117 | +Releases are managed by maintainers: |
| 118 | + |
| 119 | +- Bump version in `pyproject.toml`/`setup.py`. |
| 120 | +- Tag: `git tag vX.Y.Z`. |
| 121 | +- Push: `git push --tags`. |
| 122 | +- Upload to PyPI: `twine upload dist/*`. |
| 123 | + |
| 124 | +## Questions? |
| 125 | + |
| 126 | +- **Issues/PRs**: Use GitHub for tracking. |
| 127 | +- **Discussions**: [Start one](https://github.com/hbisneto/FileSystemPro/discussions/new) for ideas. |
| 128 | +- **Direct **: Email [[email protected]](mailto:[email protected]) or DM @BisnetoDev on X. |
| 129 | + |
| 130 | +Thanks for contributing—we're excited to collaborate! 🚀 |
0 commit comments