|
| 1 | +# Contributing to ThreadPool for Free Pascal |
| 2 | + |
| 3 | +Thanks for your interest in improving this library! Contributions of all |
| 4 | +sizes are welcome — bug reports, documentation fixes, new examples, and code. |
| 5 | + |
| 6 | +## Ways to contribute |
| 7 | + |
| 8 | +- 🐛 **Report a bug** — open an [issue](https://github.com/ikelaiah/threadpool-fp/issues) using the Bug Report template. |
| 9 | +- 💡 **Request a feature** — open an issue using the Feature Request template. |
| 10 | +- 📝 **Improve docs or examples** — these are especially appreciated and easy to start with. |
| 11 | +- 🔧 **Fix a bug or add a feature** — see the workflow below. |
| 12 | + |
| 13 | +## Prerequisites |
| 14 | + |
| 15 | +- Free Pascal 3.2.2 or later |
| 16 | +- Lazarus 3.6.0 or later (provides `lazbuild`) |
| 17 | +- No external dependencies |
| 18 | + |
| 19 | +## Building |
| 20 | + |
| 21 | +Build the package: |
| 22 | + |
| 23 | +```bash |
| 24 | +lazbuild package/lazarus/threadpool_fp.lpk |
| 25 | +``` |
| 26 | + |
| 27 | +Or compile a single example directly with FPC: |
| 28 | + |
| 29 | +```bash |
| 30 | +fpc -Fu./src examples/SimpleDemo/SimpleDemo.lpr |
| 31 | +``` |
| 32 | + |
| 33 | +## Running the tests |
| 34 | + |
| 35 | +```bash |
| 36 | +lazbuild tests/TestRunner.lpi |
| 37 | +# Windows |
| 38 | +./tests/TestRunner.exe -a -p --format=plain |
| 39 | +# Linux / macOS |
| 40 | +./tests/TestRunner -a -p --format=plain |
| 41 | +``` |
| 42 | + |
| 43 | +All tests should pass before you submit a change. The full suite can take a |
| 44 | +few minutes to run because some tests exercise high task volumes. |
| 45 | + |
| 46 | +CI runs the package build, the test suite, and all examples on Linux and |
| 47 | +Windows for every pull request — please make sure your branch is green. |
| 48 | + |
| 49 | +## Code style |
| 50 | + |
| 51 | +- Use `{$mode objfpc}{$H+}{$J-}` at the top of new units and programs. |
| 52 | +- Match the existing formatting: two-space indentation, `PascalCase` for |
| 53 | + types/methods, and a descriptive comment for non-obvious logic. |
| 54 | +- **Filenames must match the `unit` identifier's casing exactly** |
| 55 | + (e.g. unit `ThreadPool.Simple` lives in `ThreadPool.Simple.pas`). This keeps |
| 56 | + the library compiling on case-sensitive filesystems like Linux. |
| 57 | +- Keep the library dependency-free (FCL only). |
| 58 | + |
| 59 | +## Pull request workflow |
| 60 | + |
| 61 | +1. Fork the repo and create a branch off `main` |
| 62 | + (e.g. `feat/adaptive-threads` or `fix/queue-overflow`). |
| 63 | +2. Make your change, including tests and/or an example where it makes sense. |
| 64 | +3. Run the test suite locally and make sure it passes. |
| 65 | +4. Update `CHANGELOG.md` and any relevant docs in `docs/`. |
| 66 | +5. Open a pull request describing **what** changed and **why**. |
| 67 | + |
| 68 | +## Reporting security issues |
| 69 | + |
| 70 | +For anything sensitive, please email the maintainer rather than opening a |
| 71 | +public issue. |
| 72 | + |
| 73 | +Thank you for helping make this library better! 🙏 |
0 commit comments